Activity 01
Pairs: Loop Timing Challenge
Pairs write pseudocode for single and nested loops, then simulate runs by counting operations for increasing n values from 10 to 1000. They record times on charts and predict Big O classes. Discuss patterns as a class.
Why is the worst-case scenario often more important than the average case in software safety?
Facilitation TipBefore the Loop Timing Challenge, provide identical starter code on different devices so timing differences come from loop structure, not hardware.
What to look forPresent students with 3-4 code snippets, each containing a simple loop or nested loop structure. Ask students to write down the Big O notation for each snippet and briefly justify their answer by identifying the dominant operation.