← Quiz: Python Interview Programs: all 13 questions
Quiz: Python Interview Programs · Question 4 of 13
What is the time complexity of binary search?
What is the time complexity of binary search?
- A.O(n)
- B.O(log n)
- C.O(n log n)
- D.O(1)
Answer & explanation
Correct answer: O(log n)
Each step halves the search range.
Can you get the rest right without peeking?
Take the timed Quiz: Python Interview Programs quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →