Skip to content
Computer Science · 11th Grade

Active learning ideas

Introduction to Recursion

Active learning works for recursion because the concept demands students shift from linear thinking to understanding self-reference, a mental model that is hard to grasp without physical or visual representation. When students physically act out the call stack or trace code with peers, they build the spatial and temporal understanding needed to see how each recursive call connects to the next until the base case resolves.

Common Core State StandardsCSTA: 3B-AP-12
25–35 minPairs → Whole Class4 activities

Activity 01

Role Play30 min · Whole Class

Role Play: Human Call Stack

Students stand in a line, each representing one function call. The first student writes their argument on a sticky note and passes it to the next, who does the same, building the call stack. When the base case is reached, each student computes their return value from the one behind them and passes it back, simulating the recursive return.

Explain the fundamental principles of recursive problem-solving.

Facilitation TipDuring the Human Call Stack activity, position students physically to mirror the stack frame order, so the first caller is at the bottom and the deepest call is at the top.

What to look forPresent students with a simple recursive function (e.g., calculating Fibonacci numbers). Ask them to identify the base case and the recursive step, and trace the execution for an input of 3, writing down the values passed in each recursive call.

ApplyAnalyzeEvaluateSocial AwarenessSelf-Awareness
Generate Complete Lesson

Activity 02

Think-Pair-Share25 min · Pairs

Think-Pair-Share: Find the Base Case

Provide pairs with three recursive function skeletons missing their base cases. Partners identify what is missing, add a base case, and predict what would happen without it. Pairs share their reasoning before the class tests each version.

Analyze the base case and recursive step in a given recursive function.

Facilitation TipDuring the Think-Pair-Share Base Case activity, provide incomplete or intentionally broken examples so students must argue why a base case is missing or incorrect.

What to look forProvide students with the problem of summing numbers from 1 to n. Ask them to write a recursive function to solve this, ensuring they include both a base case and a recursive step. They should also briefly explain why their base case is correct.

UnderstandApplyAnalyzeSelf-AwarenessRelationship Skills
Generate Complete Lesson

Activity 03

Concept Mapping35 min · Pairs

Paired Coding: Factorial and Fibonacci Trace

Partners implement recursive factorial and Fibonacci functions, then trace the execution of factorial(4) and fibonacci(5) step by step in writing before running the code. Comparing the written trace to actual debugger output helps students verify their mental model.

Construct a simple recursive function to solve a problem like factorial or Fibonacci.

Facilitation TipDuring the Paired Coding Trace activity, require students to write both recursive and iterative versions side by side to highlight the structural differences in state management.

What to look forFacilitate a class discussion comparing a recursive factorial function with an iterative one. Ask students: 'What are the advantages and disadvantages of each approach for this specific problem? When might one be preferred over the other?'

UnderstandAnalyzeCreateSelf-AwarenessSelf-Management
Generate Complete Lesson

Activity 04

Gallery Walk30 min · Small Groups

Gallery Walk: Recursion Pattern Analysis

Post four different recursive functions around the room (binary search, sum of list, string reversal, power function). Groups rotate and annotate each one by identifying the base case, recursive step, and what value gets returned at each level.

Explain the fundamental principles of recursive problem-solving.

Facilitation TipDuring the Gallery Walk Pattern Analysis, post only student-generated examples so peers can critique naming conventions and structure rather than relying on provided templates.

What to look forPresent students with a simple recursive function (e.g., calculating Fibonacci numbers). Ask them to identify the base case and the recursive step, and trace the execution for an input of 3, writing down the values passed in each recursive call.

UnderstandApplyAnalyzeCreateRelationship SkillsSocial Awareness
Generate Complete Lesson

A few notes on teaching this unit

Experienced teachers approach recursion by first making the invisible visible. Use call-stack analogies early and often, since students struggle with the idea that each recursive call waits for the next one to finish. Avoid rushing into code; let students act out the process before writing functions. Research shows that students who manually trace examples with colored pens or sticky notes develop stronger conceptual models than those who only read code or watch animations.

By the end of these activities, students should be able to trace recursive calls, identify base cases correctly, and explain the difference between recursive and iterative approaches in their own words. Their work samples should show clear labeling of base cases and recursive steps, and their discussions should reflect confidence in predicting how recursion terminates.


Watch Out for These Misconceptions

  • During the Human Call Stack activity, watch for students who describe recursion as 'just a loop written differently' when they equate the self-call with a repeated action in a loop.

    Use the physical positions to point out that each student in the stack is waiting for the next to finish, not repeating an action—this distinction makes the difference between iteration and recursion concrete.

  • During the Think-Pair-Share Base Case activity, watch for students who assume any stopping condition is sufficient, even if it doesn’t cover all inputs.

    Ask students to test their base case with edge cases like n=0 or n=1 and explain why the base case must handle those inputs explicitly.

  • During the Paired Coding Trace activity, watch for students who believe recursive solutions are always faster or more efficient than iterative ones.

    Have students profile their recursive and iterative versions with larger inputs to observe stack depth and overhead firsthand.


Methods used in this brief