What is time complexity of binary search?
What is time complexity of binary search?
Approach: Analyze recurrence or halving argument.
O(log n). Each step halves search space. Recurrence: T(n) = T(n/2) + O(1).
Follow-up: What is space complexity?
Key concepts: divide and conquer, logarithmic time, sorted array.