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

PYQ GATE 2002

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 241 students.

Sign up free to check your answer

Sign up free

Explore the full course: Zero To Hero

Loading lesson…