Apr 18, 2026
Does a binary search algorithm require the input array to be sorted in order to work correctly?
Correct
Answer given
Yes
Answer
Yes. Binary search repeatedly halves the search space by comparing the target to the middle element, which only works if elements are in sorted order.
Ash's grade
Correct answer, but you gave no explanation — binary search requires a sorted array because it eliminates half the search space based on order comparisons.