Activity 01
Pair Programming: Loop Timing Challenge
Pairs write a single loop and a nested loop function. They test with input sizes from 10 to 1000, record runtimes in a shared sheet, and plot graphs to identify O(n) versus O(n^2). Discuss which scales better for big data.
Explain why understanding computational complexity is vital for software development.
Facilitation TipDuring the Pair Programming Challenge, circulate with a timer app to ensure students track and record accurate runtimes for each loop size.
What to look forPresent students with pseudocode for two simple algorithms, one with O(n) complexity and one with O(n^2). Ask them to identify the Big O notation for each and predict which would be faster for an input size of 1000 items, explaining their reasoning.