Question 1 of 10
Binary search on a list of numbers requires which condition?
- A. List must be sorted.
- B. Length must be a power of 2.
- C. Target must appear more than once.
- D. List contains only even numbers.
Binary search on a list of numbers requires which condition?
Sorted list [2,5,8,11,14,17,20]. Searching for 14, first middle index 4 (value 11). After 14 > 11, which values remain possible?
Sorted [1,3,5,7]. Search for 7 using lower middle each time. First middle index 2 (value 3). How many comparisons to find 7?
Which list is not appropriate for binary search?
Sorted prices [12,15,18,21,24,27]. Search for 12; first middle 18 (index 3). How many prices remain possible?
Compared with left-to-right scan of a sorted list, binary search is often:
Sorted [6,9,12,15,18]. Search for 18; first middle index 3 (value 12). After 18 > 12?
Student applies half-elimination on unsorted [10,3,8,1] seeking 10 after comparing middle-left 3. Why can keeping only the left half be invalid?
Sorted [2,4,6,8,10,12,14,16]. Search for 2; first middle index 4 (value 8). Still possible?
Binary search finishes with no remaining elements seeking T in a sorted list. Conclusion?