What is the time complexity of binary search?
Q1. What is the time complexity of binary search?
Answer: O(log n)
Explanation: Binary search divides the search interval in half with each step, resulting in a time complexity of O(log n) for n elements.