0
efficiency of algorithm is 5n^2 if a step in this takes 1 nanosec, how long does it take algorith to process input of size 1000
Algorithmic efficiency
2 Antworten
+ 10
Rehma Manal as per the given information efficiency of algorithm is 5n^2 means BigOh(5n^2) and each input step takes 1 nano second and the input size n is given 1000. So equation is made like this way
Efficiency * nano second
5*(1000*1000) * 1 * 10^-9
5* 10^6 * 10^-9
==5/10^3
== 0.005
So 0.005 second per step is taken to complete the algorithm
0.005 * 1000= 5
As total input step is 1000 so 5 second is the time to execute the algorithm.
And this is all because BigOh() is and tightly bounded and works on worst case efficiency.
0
Thanks you saved my day