The running time of the following algorithm is best described by which option?…

GATE · 2002 · CS · Question 2 subparts

The running time of the following algorithm is best described by which option? Procedure A(n): if n <= 2, return 1; otherwise return A(√n).

  1. A.

    O(n)

  2. B.

    O(log n)

  3. C.

    O(log log n)

  4. D.

    O(1)

Attempted by 204 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…