Answer the following questions All running times refer to th

Answer the following questions. All running times refer to the worst-case analysis. John came up with an algorithm for some problem that runs in time Theta (n^2 log (n)), and Bill came up with an algorithm for the same problem that runs in time o (n^2 log (n)). Based on this information, which one would you choose? Why? John tells you that a certain algorithm runs in time O (n^3 + 200n), and Bill tells you that the same algorithm runs in time Ohm (n^3). Can both John and Bill be correct? Why? John tells you that a certain algorithm runs in time Ohm (2^n + 200 n), and Bill tells you that the same algorithm runs in time Ohm (n^3). Assuming that both statements are correct, which one is more informative, i.e., gives you a better estimation of the running time? Why?

Solution

1>

i will prefer the second algorithm because in worst case time complexity is order of small omega. it means worst case taking time less than it..

but in first case time compextiy is of theta case means best case will also take same time, its lacking here.

2>

no

reason: according to john maximum time will be order of n^3 but Bill says minimum time will be order of n^3.

3>

BIll is better here because time complexity is less but john is more informative.

due to minimum time Bill is better according to me

 Answer the following questions. All running times refer to the worst-case analysis. John came up with an algorithm for some problem that runs in time Theta (n^

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site