The complexity of Binary search algorithm is
-
O(n)
-
O(log n)
-
O(n2)
-
O(n log n)
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.