Skip to content
Computer Science · Grade 12

Active learning ideas

Introduction to Algorithm Analysis

When students physically measure how algorithms behave with growing inputs, they move beyond abstract formulas and internalize why efficiency matters. Active experiments let them see firsthand how a simple loop’s runtime explodes compared to a single lookup as data scales, turning notation into observable reality.

Ontario Curriculum ExpectationsCS.AA.1CS.P.14
15–40 minPairs → Whole Class3 activities

Activity 01

Formal Debate30 min · Whole Class

Formal Debate: The Efficiency Face-Off

Two teams are given a problem (e.g., finding a duplicate in a list). One team must defend a simple O(n²) nested loop, while the other defends a more complex O(n) hash map approach, debating based on readability vs. speed.

Explain why analyzing algorithm efficiency is critical for large-scale software development.

Facilitation TipDuring the Efficiency Face-Off debate, assign roles (e.g., 'advocate for O(n)') to ensure every student engages with the evidence.

What to look forProvide students with pseudocode for two simple algorithms that solve the same problem (e.g., linear search vs. binary search). Ask them to: 1. Identify the Big O time complexity for each. 2. Explain which algorithm would be more efficient for a very large dataset and why.

AnalyzeEvaluateCreateSelf-ManagementDecision-Making
Generate Complete Lesson

Activity 02

Simulation Game40 min · Small Groups

Simulation Game: The Scaling Race

Students perform tasks (like sorting cards) using different algorithms. They record the time taken for 5 cards, 10 cards, and 20 cards, then graph the results to see which 'curve' their performance follows.

Compare different metrics for evaluating algorithm performance beyond just execution time.

Facilitation TipWhen running The Scaling Race simulation, pause after each dataset size to let students record predictions before revealing actual timings.

What to look forPresent students with a list of algorithm descriptions (e.g., iterating through an array once, nested loops iterating through an array, a single lookup). Ask them to match each description to its corresponding Big O notation (O(n), O(n²), O(1)).

ApplyAnalyzeEvaluateCreateSocial AwarenessDecision-Making
Generate Complete Lesson

Activity 03

Think-Pair-Share15 min · Pairs

Think-Pair-Share: Identifying the Bottleneck

Provide a complex code snippet with multiple loops. Pairs must identify which part of the code contributes most to the Big O complexity and explain why the smaller parts are 'dropped' in notation.

Predict how a small change in an algorithm's design might impact its overall efficiency.

Facilitation TipFor Identifying the Bottleneck, provide printed snippets of pseudocode so pairs can annotate line by line without screen distractions.

What to look forPose the question: 'Imagine you are developing a social media platform. Why is it more critical to optimize algorithms for displaying news feeds (potentially millions of users) than for changing a user's profile picture (a single operation)?' Guide students to discuss scalability and resource management.

UnderstandApplyAnalyzeSelf-AwarenessRelationship Skills
Generate Complete Lesson

A few notes on teaching this unit

Start with concrete examples—have students time a linear search on paper lists of 10, 100, and 1,000 names to feel the O(n) growth. Avoid rushing to formulas; let the discomfort of manual counting build intuition. Research shows that when students grapple with raw data first, they later transfer that understanding to abstract cases more successfully.

By the end of these activities, students will confidently classify algorithms using Big O notation and justify their choices with evidence from simulations or debates. They will articulate trade-offs between time and space and recognize when a 'slower' algorithm might still be practical for small datasets.


Watch Out for These Misconceptions

  • During the Scaling Race activity, watch for students who assume Big O predicts exact runtime in seconds.

    Pause the simulation after the first dataset and ask groups to note: 'What changed between Computer A and Computer B?' Redirect them to observe that while seconds differ, the growth rate (e.g., doubling input size doubles time) stays consistent.

  • During the Efficiency Face-Off debate, students may claim O(n²) is always worse than O(n).

    Use the debate’s scoreboard to highlight a small-data scenario—provide a concrete example where O(n²) completes first (e.g., 3 items). Ask debaters to defend when simplicity beats theoretical efficiency, tying it to real constraints like hardware or deadlines.


Methods used in this brief