If a program executes in 2seconds with n=10, how much time will it take to execute n=100 with complexity n * log(n)? I thought about it and I think it’s probably 4seconds, but how can I prove it?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming the time taken is exactly proportional to n*log(n), and not just an upper bound (see http://en.wikipedia.org/wiki/Big_O_notation#Family_of_Bachmann.E2.80.93Landau_notations), you’d have:
Plug in n=10 and solve for the constant. Now you have an expression for the execution time at every n.