Question: Consider two algorithms: Algorithm A and Algorithm B both of which solve problem F Suppose you know that all of the following statements are true.

Consider two algorithms: Algorithm A and Algorithm B both of which solve problem F Suppose you know that all of the following statements are true. Statement 1: the asymptotic running time of Algorithm Ais (n2 logn); Statement 2: the asymptotic running time of Algorithm Bis O(n3); Statement 3: the best-case running time of Algorithm B is (n2); Statement 4: All algorithms that solve problem P have a worst-case running time that is (n2 logn) For each of the following statements, indicate whether you have suf- ficient information about the algorithms to justify the claim being made. Fully explain your answers. (a) We know that the asymptotic running time of Algorithm A is [7 marks] (b) It is possible that the asymptotic running time of Algorithm B is [7 marks] (c) It is possible that the asymptotic running time of Algorithm B is [7 marks] (d) In any scenario where you need to solve instances of problem S2(n2) (n3). 0(n2) P, you would achieve better running time by using Algorithm A rather than Algorithm B
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
