Trace a search algorithm
Sorted list: [4,9,15,21,30,44,58]. Binary search seeks 30: compare 21, then 44, then 30.
- Each comparison discards half the remaining range.
- Three comparisons find the target.
- Sorted order is required.
algorithms, data structures, and system behavior
Sorted list: [4,9,15,21,30,44,58]. Binary search seeks 30: compare 21, then 44, then 30.
Pause. Find what matters. Then make your move.