Preview
IB DP Computer Science — B2 Programming — Programming algorithms | HL | B2.4.4
📋 What You Will Learn
- Explain what recursion is: a function that calls itself with a base case and a recursive case
- Describe how the call stack manages recursive calls (winding and unwinding)
- Explain the utility of recursion for problems built from smaller, similar sub-problems
- Describe recursive applications: quicksort, binary-tree traversal and fractal image creation
- Evaluate recursion's advantages against its limitations in complexity and memory usage
🪆 Why This Matters A Russian doll is "a doll containing a smaller Russian doll — until the smallest, solid one." That is a recursive definition: each layer is solved by the same idea applied to something smaller, and a base case stops the descent. Recursion lets programs be written the same way.
What Recursion Is
- A recursive function calls itself to solve a smaller version of the same problem.