Activity 01
Pairs Coding: Build and Test Searches
Pairs write linear and binary search functions in Python or pseudocode. Test on unsorted and sorted lists of 20, 200, and 2000 elements, counting steps or using time functions. Pairs graph results and present one insight to class.
Compare the efficiency of linear search versus binary search.
Facilitation TipDuring Pairs Coding, remind students to print or log each comparison so they can trace mismatches between their code and the algorithm's intention.
What to look forProvide students with a small, unsorted list of numbers and a target number. Ask them to manually trace the steps of a linear search, writing down each comparison made. Then, ask them to explain why binary search would not work on this specific list.