Question: 1. Suppose that you have to choose between three algorithms A1, A2 and A3 for a given problem. The worst-case running time for each algorithm

1. Suppose that you have to choose between three algorithms A1, A2 and A3 for a given problem. The worst-case running time for each algorithm is given by W1(n) = 100n; W2(n) = 2n log10 n; W3(n) = 0.1n 2 . Answer the following questions, explaining your assumptions and possible limitations of your analysis.

(a) Order the algorithms from fastest to slowest in the sense of asymptotic worst-case running time.

(b) Suppose that we run each algorithm on a large problem instance of size n. Then we feed in an input of size 100n and re-run the algorithms on the new input. What would you expect to happen to the running times, and why?

(c) Suppose that hardware limitations mean that your algorithm can only accept input of size at most 106 . Which algorithm would you prefer, and why? Answer the same question with 106 replaced by 103 .

(d) For which problem sizes is A1 the best algorithm to use? Answer the same question for A2 and then for A3.

(e) Suppose that we have 109 time units available. What is the maximum input size that can be processed by each of the algorithms in that time?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!