Activity 01
Pair Programming: Search Timing
Students in pairs implement linear and binary search in Python. They test on sorted arrays from size 100 to 1,000,000, averaging runtimes over 20 trials. Pairs graph results and infer Big O notations from slopes.
Evaluate the trade-offs between an algorithm's time complexity and its space complexity.
Facilitation TipDuring Pair Programming: Search Timing, set a minimum input size of 10,000 elements to ensure differences between O(n) and O(n^2) are measurable and meaningful.
What to look forProvide students with 2-3 short code snippets (e.g., a loop, a nested loop, a recursive function call). Ask them to write down the Big O time complexity for each snippet and a brief justification. For example: 'This code has a time complexity of O(n) because it iterates through the input array once.'