Skip to content
Computer Science · Class 12

Active learning ideas

Recursion: Concepts and Base Cases

Recursion can feel abstract to students until they see the call stack grow and shrink. Active learning lets them trace the process step by step, turning invisible steps into visible patterns. Pairs and groups make the moment of recursion’s unwinding clearer than any lecture alone could do.

CBSE Learning OutcomesCBSE: Computational Thinking and Programming - Functions - Class 12
25–40 minPairs → Whole Class4 activities

Activity 01

Problem-Based Learning30 min · Pairs

Pair Tracing: Factorial Calls

Pairs draw recursion trees for factorial(5) on paper, labelling base cases and return values step by step. They then trace Fibonacci(6), noting stack depth. Pairs discuss and compare their diagrams with the class.

Explain the fundamental principles of recursion and its application in problem-solving.

Facilitation TipDuring Pair Tracing, ask each pair to write each function call on a separate sticky note so the growing stack becomes a physical tower on the desk.

What to look forProvide students with a simple recursive function (e.g., calculating sum of numbers up to n). Ask them to write down the base case and the recursive step, and then trace the execution for n=3, showing the output.

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 02

Problem-Based Learning40 min · Small Groups

Small Group Debug: Base Case Fix

Provide small groups with buggy recursive code for sum of numbers lacking a base case. Groups identify the issue, add the base case, and test with print statements. Share fixes in a class gallery walk.

Analyze the role of a base case in preventing infinite recursion.

Facilitation TipIn Small Group Debug, give groups a print-out of the code with deliberate missing base cases; let them run it once to crash, then fix it together.

What to look forPresent two code snippets, one iterative and one recursive, for calculating the factorial of a number. Ask students to identify which is which and explain one advantage of the iterative approach and one advantage of the recursive approach in this context.

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 03

Problem-Based Learning25 min · Whole Class

Whole Class: Human Recursion Chain

Students line up to represent recursive calls for Fibonacci(4), passing values backward from base cases. The chain 'unwinds' to compute the result. Debrief on stack overflow risks with a too-long chain.

Compare iterative and recursive solutions for common problems like Fibonacci sequences.

Facilitation TipFor the Human Recursion Chain, use a stopwatch to time how long it takes the chain to unwind so students feel the cost of deep recursion.

What to look forPose the question: 'What would happen if a recursive function did not have a base case?' Facilitate a class discussion where students explain the concept of infinite recursion and its consequences, such as a stack overflow error.

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 04

Problem-Based Learning35 min · Individual

Individual Code: Simple Tower

Each student writes and runs a recursive function to print a tower of asterisks, varying height. They add print statements to observe call order, then modify for a base case change.

Explain the fundamental principles of recursion and its application in problem-solving.

Facilitation TipWhen students build the Simple Tower individually, insist they draw the call tree first before coding to strengthen visual understanding.

What to look forProvide students with a simple recursive function (e.g., calculating sum of numbers up to n). Ask them to write down the base case and the recursive step, and then trace the execution for n=3, showing the output.

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
Generate Complete Lesson

A few notes on teaching this unit

Teachers often start with the factorial example because it is familiar, but students also need to see the same pattern in tree traversals. Avoid rushing to code; spend time on tracing first. Research shows that students grasp recursion better when they physically act out the calls before writing them, so use human chains early. Emphasise the stack metaphor—show a glass of water filling and emptying as calls are made and returned—because concrete images anchor abstract ideas.

By the end of these activities, students should confidently identify the base case and recursive step in any simple function. They should be able to trace a recursive call and explain why a missing base case causes the programme to fail. Watch for students who can now compare recursion and iteration with reasoned arguments.


Watch Out for These Misconceptions

  • During Pair Tracing, watch for students who think recursion always runs faster than iteration because no loop overhead exists.

    Use the sticky-note tower to show how each recursive call stores a return address, increasing memory usage. Ask pairs to count the number of notes for n=5 and compare it to the memory used by a loop that runs five times.

  • During Small Group Debug, students may believe base cases are optional for small inputs.

    Give groups code that crashes for n=10 but seems to work for n=2. Have them run it and observe the stack overflow error, then insert the missing base case to fix it.

  • During Human Recursion Chain, students might think recursion and iteration solve the same problems identically.

    Time the human chain for Fibonacci(4) and then simulate an iterative loop for the same value. Ask students to compare the number of steps and the clarity of each approach.


Methods used in this brief