← Binary Search Quiz: all 8 questions
Binary Search Quiz · Question 6 of 8
"Binary search on the answer" works when…
"Binary search on the answer" works when…
- A.If a value x is feasible, every larger value is also feasible (or every smaller one)
- B.The input array is sorted
- C.The answer is always an index
- D.There are no duplicates
Answer & explanation
Correct answer: If a value x is feasible, every larger value is also feasible (or every smaller one)
A monotonic yes/no condition over the answer range lets you discard half of the candidates each step.
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 →