in Programming edited by
1,263 views
0 votes
0 votes

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
in Programming edited by
by
1.3k views

1 Answer

2 votes
2 votes
Best answer
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
selected by

2 Comments

@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.
0
0
Yes, C is the correct answer . Your answer is correct , i fixed that issue , now marks will increase i think .
0
0
Answer:

Related questions