Skip to main content
G11 SUPER GIO
123
01
LEARN MISSIONalgorithms, data structures, and system behavior

algorithms, data structures, and system behavior

WORKED MODELWORKED SOURCE

Trace a search algorithm

Sorted list: [4,9,15,21,30,44,58]. Binary search seeks 30: compare 21, then 44, then 30.

  1. Each comparison discards half the remaining range.
  2. Three comparisons find the target.
  3. Sorted order is required.

Why is binary search valid here?

MODELAlgorithm Trace Deck
DATA
PROVEChoose with evidence
CLUE

Pause. Find what matters. Then make your move.