â Quiz: Recurrence Relations: all 10 questions
Quiz: Recurrence Relations ¡ Question 9 of 10
Which recurrence describes binary search?
Which recurrence describes binary search?
- A.T(n) = T(n/2) + O(1)
- B.T(n) = 2T(n/2) + O(n)
- C.T(n) = T(n â 1) + O(n)
- D.T(n) = 2T(n â 1) + 1
Answer & explanation
Correct answer: T(n) = T(n/2) + O(1)
One half of the array is searched, with constant work per step: O(log n).
Can you get the rest right without peeking?
Take the timed Quiz: Recurrence Relations quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz â