Skip to content
Computer Science · Grade 10

Active learning ideas

Introduction to Algorithms

Active learning helps students grasp algorithms because efficiency is best understood through concrete, hands-on comparisons. Moving beyond abstract explanations allows students to feel the difference between a naive approach and an optimized one, making the concept memorable and meaningful.

Ontario Curriculum ExpectationsCS.HS.A.1CS.HS.A.2
15–45 minPairs → Whole Class3 activities

Activity 01

Think-Pair-Share30 min · Whole Class

Human Sorting Race

Divide the class into two teams to sort a deck of cards using different algorithms, such as Bubble Sort versus Merge Sort. Students physically move the cards while a timer runs to visualize how the number of operations increases with input size.

Differentiate between an algorithm and a set of instructions.

Facilitation TipDuring the Human Sorting Race, circulate to listen for students justifying their sorting choices with phrases like 'fewer comparisons' or 'less movement.'

What to look forProvide students with a simple task, like tying shoelaces. Ask them to write down the steps as an algorithm. Then, ask them to identify the input, output, and explain why each step must be definite and effective.

UnderstandApplyAnalyzeSelf-AwarenessRelationship Skills
Generate Complete Lesson

Activity 02

Think-Pair-Share15 min · Pairs

Think-Pair-Share: The Grocery Store Path

Students individually map the most efficient route to pick up five specific items in a local grocery store. They then pair up to compare routes and discuss which 'algorithm' used the least amount of 'memory' (steps) or 'time'.

Analyze how everyday tasks can be represented as algorithms.

Facilitation TipWhile students are working on The Grocery Store Path, ask pairs to explain which path they chose and how they measured its length.

What to look forPresent students with two sets of instructions for the same task (e.g., making toast). One set is vague, the other is precise. Ask students to identify which is a better algorithm and explain why, focusing on definiteness and finiteness.

UnderstandApplyAnalyzeSelf-AwarenessRelationship Skills
Generate Complete Lesson

Activity 03

Inquiry Circle45 min · Small Groups

Inquiry Circle: Code Golf

Small groups are given a simple task, like finding a prime number, and must compete to write the shortest and then the fastest version of the code. They present their findings to the class to explain the trade-offs between readability and speed.

Justify the importance of clear and unambiguous steps in an algorithm.

Facilitation TipWhen running Code Golf, remind students that the goal is not to write the shortest code but to write code that runs fastest with large inputs.

What to look forPose the question: 'Can a conversation be considered an algorithm?' Facilitate a discussion where students apply the characteristics of an algorithm (input, output, finiteness, definiteness, effectiveness) to justify their answers.

AnalyzeEvaluateCreateSelf-ManagementSelf-Awareness
Generate Complete Lesson

A few notes on teaching this unit

Teachers should start by making efficiency tangible through physical activities before moving to code. Emphasize that optimization is about trade-offs, and that students should always ask, 'What happens if the input is 100 times larger?' Avoid rushing to formal notation; let students describe complexity in their own words first. Research shows that when students physically experience inefficiency, they better understand why certain algorithmic choices matter.

Students will articulate why one algorithm performs better than another using terms like time and space complexity. They will also recognize that clarity in steps matters as much as brevity, and that algorithms must be tested with realistic data sizes to reveal true efficiency.


Watch Out for These Misconceptions

  • During the Human Sorting Race, watch for students who believe that sorting faster means they did the task well without analyzing the steps.

    Ask students to write down the exact steps they took and count the number of comparisons or movements they made. Then, compare these counts across teams to highlight why some approaches are more efficient regardless of speed.

  • During Code Golf, watch for students who submit the shortest code without testing it on large inputs.

    Provide a large dataset and ask students to run their code. When it takes too long, guide them to rewrite their solution using a more efficient logic, even if it means adding more lines.


Methods used in this brief