Question: Suppose we have two different algorithms to solve a problem. Algorithm A requires 10n instructions to solve the problem. Algorithm B requires 2 in- structions

Suppose we have two different algorithms to solve a problem. Algorithm A requires 10n" instructions to solve the problem. Algorithm B requires 2" in- structions to solve problem. Suppose you code up algorithm A and run it on a computer that can execute, say million instructions per second. Suppose yon code up algorithm B and run it on a computer that runs 1000 times faster than the other computer (i.e., this computer can execute billion instructions per second). Compare the running time of the two algorithms (on the respec- tive computers) for input sizes of n = - 20, n = 30, and n = 40. Express the running times in suitable units (such as seconds, minutes, hours, days or years). Assume that an year has ently 365 days. What is the conclusion that you can draw from your results. (10 Pts.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
