Activity 01
Pair Programming: Linear vs Binary Search
Pairs write Python functions for linear and binary search on lists of 10-100 items. They time each using time module, then swap code to test and debug. Discuss which performs better on sorted data.
Compare the efficiency of a linear search versus a binary search algorithm.
Facilitation TipDuring Pair Programming: Linear vs Binary Search, assign roles clearly and have partners swap roles after each search to share cognitive load.
What to look forPresent students with a small, unsorted list of numbers and a target value. Ask them to manually trace the steps of a linear search and a binary search, recording the number of comparisons each algorithm makes.