Question: (20 points) Suppose you implemented a quadratic time (that is O(n2) ) algorithm for a problem P. On a test run, your algorithm takes 50

(20 points) Suppose you implemented a quadratic time (that is O(n2) ) algorithm for a problem P. On a test run, your algorithm takes 50 seconds on inputs of size 1000 . Your friend found a clever algorithm which solves the same problem with a running time O(n3/2). However, the faster algorithm takes 150 seconds on inputs of size 1000. How could this be? If you need to solve a problem of size 4000, which algorithm you should use? What about inputs of size 10,000? Explain your answers (assume low-order terms are negligible)
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
