Coding · Grade 11
Recursion and Problem Decomposition
Learners build recursive solutions from base cases and smaller subproblems, tracing them with the call stack and indented call logs. They design recursive functions for palindromes, powers by halving, digit sums and lists, test them against hidden buggy versions, analyse costs with call trees (including Fibonacci's exponential blow-up and memoisation), and decide when iteration is the better choice.
- 4 lessons
- About 100 minutes
- Check what you learned: 8 questions
- Ways to answer: choose an answer, put code in order, trace code, type a number, sort into groups and write tests
What learners will discover
- Identify base and recursive cases and trace recursive calls using the call stack.
- Design recursive solutions by decomposing problems into smaller instances of themselves.
- Analyse recursive algorithms with call trees, including exponential blow-up and memoisation.
- Choose between recursion and iteration based on problem shape, efficiency and depth limits.
Lessons
-
Base cases and the call stack 6 steps3 practiceabout 22 min
-
Thinking recursively 5 steps3 practiceabout 24 min
-
The cost of recursion 5 steps3 practiceabout 22 min
-
Recursion or iteration? 4 steps3 practiceabout 18 min
-
Check what you learned 8 questions at the end
Keep exploring
More 11th grade coding
- 11th Grade Coding Worksheets12 printable worksheets
Guide for grown-ups
- How to start homeschooling: a step-by-step guide for familiesA guide for parents · 7 min read