The time complexity of binary search on a sorted array of n elements is:
2025
The time complexity of binary search on a sorted array of n elements is:
- A.
O(n)
- B.
O(n log n)
- C.
O(log n)
- D.
O(1)
Attempted by 54 students.
Show answer & explanation
Correct answer: C
Binary search halves the search interval at every step, so its time complexity on a sorted array is O(log n).