What is the worst-case time complexity of Binary Search?
- A. O(n)
- B. O(log n) ✓
- C. O(n log n)
- D. O(1)
Correct answer
B. O(log n)
Explanation
Binary Search repeatedly halves the search space, resulting in O(log n) time.
B. O(log n)
Binary Search repeatedly halves the search space, resulting in O(log n) time.