1,263 views

Three algorithms do the same task. Algorithm One is $O(N)$ and Algorithm Two is $O(\log N)$ and Algorithm Three is $O(N1/2)$. Which algorithm should execute the fastest for large values of $N$?

1. $O(N1/2)$
2. $O(N)$
3. $O(\log N)$
4. both A and B

To find out the fastest execution for a given upper bound , just check the behaviour of the functions(upper bound) for large values of N....the lower the value,  faster the execution

Here in this case its obvious that logn < n^1/2 for large values of N as you can check from their graph too..and therefore logn < n (obvious) so logn - c is correct option

@bikram sir, Isn't C correct? I did mark option C but got negative marks for that. The correct ans given is '3' in the result.
Yes, C is the correct answer . Your answer is correct , i fixed that issue , now marks will increase i think .

1
1 vote
2
460 views
3
226 views