Exam-style question
Try this first
What is the time complexity of binary search?.
- A.O(1)
- B.O(log n)
- C.O(n)
- D.O(n²)
Answer and explanation
Concise answer
O(log n)
Why this is correct
Binary search repeatedly halves the part of the list that still needs to be searched, giving a time complexity of O(log n).
Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.
Common mistake
No common mistake is linked to this question yet.
