What condition makes classic binary search possible?
Practice this question from Binary Search - Classic search Pattern Practice Quiz, with options and an explanation.
Question
What condition makes classic binary search possible?
Option A — Correct answer
The array is sorted
Option B
The array contains only positive values
Option C
The array length is even
Option D
The target is always present
Explanation
The array must be sorted so one half can be discarded after each comparison.