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

Binary Search Quiz · Question 4 of 8

Which statements about binary search are true? (select all that apply)

Which statements about binary search are true? (select all that apply)

  1. A.It needs sorted (or monotonic) data
  2. B.Its time complexity is O(log n)
  3. C.It works on any unsorted array
  4. D.It always needs O(n) extra space
Answer & explanation

Correct answer: It needs sorted (or monotonic) data · Its time complexity is O(log n)

The iterative version uses O(1) space and only works when the order tells you which half to discard.

Can you get the rest right without peeking?

Take the timed Binary Search Quiz quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →