Multiple choice technology architecture

The complexity of Binary search algorithm is

  1. O(n)

  2. O(log n)

  3. O(n2)

  4. O(n log n)

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Binary search works by repeatedly dividing the search interval in half, eliminating half of the remaining elements each time. This logarithmic reduction means time complexity is O(log n), making it much faster than linear O(n) search for sorted data.