Binary search requires that the list it searches is first:
AStreamed
BSorted
CShuffled
DShortened
Answer & Solution
Correct answer: B. Sorted
1. Each comparison discards half the list.
2. That only works if order is known.
3. So the list must be sorted.
_Source: OpenStax Introduction to Computer Science, Chapter 3, Data Structures and Algorithms._
Keep practising Data Structures and Algorithms
Browse all Data Structures and Algorithms questions for Coding Interview Prep, or explore more Computer Science topics.