Activity 01
Algorithm Race: Linear vs. Binary
Students pair up and write code for both linear and binary search. They then time each algorithm searching for a target value in lists of 100, 1000, and 10000 elements. Results are recorded and discussed.
Compare the efficiency of linear search and binary search algorithms.
Facilitation TipFor the card sort simulation, prepare two identical decks, one shuffled and one ordered, so students can immediately test binary search failures on unsorted data.