What is the worst-case time complexity of binary search on a sorted array?

Options

  • A. O(1)
  • B. O(log N)
  • C. O(N)
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

B. O(log N)

Detailed Explanation

The worst-case time complexity of binary search is O(log N). Binary search repeatedly divides the search interval into two approximately equal parts. For N elements, the number of divisions required is proportional to log2N. For example, searching among 1,024 elements requires at most about 10 divisions. This makes binary search significantly faster than linear search for large sorted datasets.