- A O(log n)
- B O(n)
- C O(n log n)
- D O(1)
Answer:
A
Binary search is an efficient search algorithm that operates on sorted arrays by repeatedly dividing the search interval in half. In each iteration, it compares the middle element with the target element and adjusts the search range accordingly. This process continues until the target element is found or the search range becomes empty. Since each comparison reduces the search space by half, the time complexity of binary search is logarithmic with respect to the number of elements in the array, denoted as O(log n).