Activity 01
Pairs Trace: Loop Counting
Pairs select algorithms like linear search and nested sum. Trace on paper for n=5,10,20, counting operations each time. Plot steps against n, then swap and compare graphs.
Explain why algorithm efficiency is crucial for large datasets.
Facilitation TipDuring Pairs Trace, provide printed code snippets with line numbers so students can annotate each operation count clearly.
What to look forProvide students with two simple code snippets: one performing a single loop (e.g., finding the maximum in a list) and another with nested loops (e.g., checking for duplicates by comparing every pair). Ask them to write down the Big O notation for each and explain which would be slower for 1000 items and why.