Binary Search MCQ Practice

Question 1 of 10

Binary search on a list of numbers requires which condition?

  1. A. List must be sorted.
  2. B. Length must be a power of 2.
  3. C. Target must appear more than once.
  4. D. List contains only even numbers.

Question 2 of 10

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?

  1. A. 11 only
  2. B. 14, 17, 20
  3. C. 2, 5, 8, 11, 14, 17, 20
  4. D. 2, 5, 8

Question 3 of 10

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?

  1. A. 1
  2. B. 2
  3. C. 3
  4. D. 4

Question 4 of 10

Which list is not appropriate for binary search?

  1. A. Sorted [1]
  2. B. Sorted [4,4,9,12]
  3. C. Sorted [-3,0,2,10]
  4. D. Unsorted [9,2,15,4]

Question 5 of 10

Sorted prices [12,15,18,21,24,27]. Search for 12; first middle 18 (index 3). How many prices remain possible?

  1. A. 2
  2. B. 3
  3. C. 6
  4. D. 1

Question 6 of 10

Compared with left-to-right scan of a sorted list, binary search is often:

  1. A. Less efficient because it starts in the middle.
  2. B. More efficient because each comparison can eliminate about half the remaining data.
  3. C. Illegal on the AP CSP exam.
  4. D. Only usable when the target is absent.

Question 7 of 10

Sorted [6,9,12,15,18]. Search for 18; first middle index 3 (value 12). After 18 > 12?

  1. A. The search must restart at index 1.
  2. B. Only values left of 12 remain possible.
  3. C. Only values right of 12 remain possible.
  4. D. The entire list remains possible.

Question 8 of 10

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?

  1. A. Binary search forbids comparing the middle.
  2. B. Lists cannot hold 10.
  3. C. Because 10 > 3 so left is always correct.
  4. D. Without sorted order, discarding a half can throw away the target.

Question 9 of 10

Sorted [2,4,6,8,10,12,14,16]. Search for 2; first middle index 4 (value 8). Still possible?

  1. A. 2, 4, 6
  2. B. 8, 10, 12, 14, 16
  3. C. 2 only
  4. D. All eight elements

Question 10 of 10

Binary search finishes with no remaining elements seeking T in a sorted list. Conclusion?

  1. A. T must be the middle element.
  2. B. T is not in the list.
  3. C. The list was unsorted.
  4. D. A sequential search would find T.