Search, sort and cost
Level 1 · estimatedSearch a row of cards one by one and by halves, put cards in order two ways, and count the comparisons each procedure makes as the row grows.
Lessons
Read the whole unit on one page
- Count comparisons in a linear searchLevel 1 · Foundations
- Keep a sorted interval for binary searchLevel 1 · Foundations
- Insert one card into sorted orderLevel 1 · Foundations
- Trace a sort on repeated keysLevel 1 · Foundations
- Compare work as the collection doublesLevel 1 · Foundations
Sources
- AP Computer Science Principles Course and Exam Description. College Board. All rights reserved. Read 2 Dec 2026. Cited in Count comparisons in a linear search, Keep a sorted interval for binary search, Compare work as the collection doubles.
- Computer Science Field Guide: Algorithms, 2.2 Searching. University of Canterbury Computer Science Education Research Group. CC BY-SA 4.0. Read 2 Dec 2026. Cited in Count comparisons in a linear search, Keep a sorted interval for binary search, Compare work as the collection doubles.
- Computer Science Field Guide: Algorithms, 2.3 Sorting. University of Canterbury Computer Science Education Research Group. CC BY-SA 4.0. Read 2 Dec 2026. Cited in Count comparisons in a linear search, Insert one card into sorted order, Trace a sort on repeated keys, Compare work as the collection doubles.