Question 1
EasyWhich condition must hold before binary search can be used on an array?
- A.
The array must be small
- B.
The array must have no negatives
- C.
The array must be sorted
- D.
The array must be stored in a linked list
Show answer and explanation
Answer: C
Binary search discards half of the range on each comparison, which only works on sorted data.