🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Recurrence Relations: all 10 questions

Quiz: Recurrence Relations ¡ Question 9 of 10

Which recurrence describes binary search?

Which recurrence describes binary search?

  1. A.T(n) = T(n/2) + O(1)
  2. B.T(n) = 2T(n/2) + O(n)
  3. C.T(n) = T(n − 1) + O(n)
  4. 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 →