Recursion fundamentals
- Stage
- 1
- Module
- M1.14
- Lessons
- 1
In this module
- Split a problem into a base case and a recursive case.
- Trace how the call stack grows as newer calls stack on top, then unwinds as each one finishes.
- Recognize the recursion limit and read a
RecursionError.
Before this module
Lessons
Practice
Try this on the judge. The link opens the problem on DMOJ.
- 2015 J5π-day (opens on DMOJ in a new tab) DMOJ
Count the ways to hand out pieces of pie to a group of people, in order.
Why DMOJ: Its smallest subtask is a good fit at this stage, included here for extra practice.