What is the time complexity of the binary search algorithm?

What is the time complexity of the binary search algorithm?

  1. A.

    O(n)

  2. B.

    O(log n)

  3. C.

    O(n^2)

  4. D.

    O(n log n)

Attempted by 573 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…