Which of the following best explains why binary search requires a sorted list?
-
A
Binary search only works with numbers, not strings
-
B
Binary search divides the list in half and discards the half that cannot contain the target, which only works if elements are ordered
-
C
Binary search checks every element, so order doesn't matter
-
D
Binary search requires a list with an even number of elements