What is the time complexity of binary search and why?
Class 11medium👁 1 views
🤖
AI Step-by-Step Solution
Verified by MscTutor AI
The time complexity of binary search is $O(\log n)$ because the search interval is halved at every step, so at most $\lceil \log_2 n \rceil$ comparisons are needed.
📚 Study More