Skip to content
Computer Science · Grade 11

Active learning ideas

Recursive Thinking: Fundamentals

Recursive thinking requires students to visualize processes that unfold over time and space, which is hard to grasp through passive methods like lectures alone. Active learning lets them experience recursion physically and collaboratively, making abstract function calls and stack frames concrete through hands-on work.

Ontario Curriculum ExpectationsCS.HS.A.2CS.HS.A.3
25–45 minPairs → Whole Class4 activities

Activity 01

Concept Mapping30 min · Pairs

Pair Programming: Factorial Tracer

Pairs write a recursive factorial function in Python, test with inputs from 0 to 5, and draw the call stack on paper for n=4. Partners alternate coding and explaining each recursive step. End with modifying for memoization.

How does breaking a problem into recursive steps change our mental model of the solution?

Facilitation TipDuring Pair Programming: Factorial Tracer, have students alternate roles every three lines of code to ensure both practice tracing and writing recursive calls.

What to look forPresent students with a pseudocode snippet of a recursive function (e.g., factorial). Ask them to identify the base case and the recursive step, and explain in one sentence how the input changes in the recursive call.

UnderstandAnalyzeCreateSelf-AwarenessSelf-Management
Generate Complete Lesson

Activity 02

Concept Mapping45 min · Small Groups

Small Groups: Tower of Hanoi Build

Groups use 3-5 blocks to physically solve Tower of Hanoi for 3 disks, then map moves to recursive pseudocode. Record steps on chart paper and present the base case and recursive logic. Compare to an online simulator.

What are the risks of using recursion in environments with limited stack memory?

Facilitation TipDuring Small Groups: Tower of Hanoi Build, limit the group to four moves per turn to prevent frustration and encourage systematic planning.

What to look forProvide students with a simple problem description (e.g., counting down from N). Ask them to write the base case and the recursive step for a function that solves this problem recursively. Then, ask them to list one potential risk of using recursion for this problem.

UnderstandAnalyzeCreateSelf-AwarenessSelf-Management
Generate Complete Lesson

Activity 03

Concept Mapping35 min · Whole Class

Whole Class: Recursion vs Loop Challenge

Project recursive and iterative Fibonacci functions. Class times execution for n=30, discusses stack overflow errors. Students vote on scenarios favoring each approach and justify with complexity analysis.

When does a recursive approach become less efficient than an iterative one?

Facilitation TipDuring Whole Class: Recursion vs Loop Challenge, provide a timer and graph paper so students can plot speed and memory use visually.

What to look forPose the question: 'Imagine you have a very large number to process recursively. What could go wrong, and how might you prevent it?' Guide students to discuss stack overflow and the importance of a well-defined base case.

UnderstandAnalyzeCreateSelf-AwarenessSelf-Management
Generate Complete Lesson

Activity 04

Concept Mapping25 min · Individual

Individual: Stack Debugger

Students receive buggy recursive code causing overflow, predict failure points, add print statements to trace, and fix with iteration. Submit annotated code with observations on call depth.

How does breaking a problem into recursive steps change our mental model of the solution?

Facilitation TipDuring Individual: Stack Debugger, supply colored index cards so students can physically separate each function call and stack frame.

What to look forPresent students with a pseudocode snippet of a recursive function (e.g., factorial). Ask them to identify the base case and the recursive step, and explain in one sentence how the input changes in the recursive call.

UnderstandAnalyzeCreateSelf-AwarenessSelf-Management
Generate Complete Lesson

A few notes on teaching this unit

Teachers should emphasize tracing over memorization, as recursion is a skill best developed by walking through examples step-by-step. Avoid rushing into complex problems before students confidently identify base cases and recursive steps. Research shows that students learn recursion best when they experience it through multiple modalities, including physical models, code, and real-world analogies.

Students will recognize base cases and recursive steps in problem-solving, explain why recursion terminates, and compare its efficiency to iteration. They will also identify when recursion is appropriate and when simpler methods would work better.


Watch Out for These Misconceptions

  • During Pair Programming: Factorial Tracer, watch for students who assume recursion is always faster because it feels more elegant.

    Have pairs measure and compare the runtime of their recursive and iterative implementations using a stopwatch and large inputs like 10,000 to observe the overhead of recursive calls.

  • During Small Groups: Tower of Hanoi Build, watch for students who skip writing out base cases, assuming they can add them later.

    Require groups to write the base case on a sticky note before touching the disks, then verify it terminates the smallest possible puzzle.

  • During Individual: Stack Debugger, watch for students who believe recursion and loops use the same amount of memory.

    Ask students to count and label each stack frame on their index cards, then compare the total height for recursive calls versus loops for the same output.


Methods used in this brief