Languages / Knowledge library
Recursion
Defines a computation in terms of smaller instances of itself
Why learn Recursion?
It naturally expresses trees, divide-and-conquer, and inductive structures
The problem it solves
It solves self-similar problems with a base case and recursive step
Where it came from
Recursion is a programming language and runtime concept that defines a computation in terms of smaller instances of itself. Its guarantees and tradeoffs depend on the concrete implementation and operating context.
Build your understanding
Work through these exercises in order. Try the task before opening a reference.
- Define Recursion and distinguish it from a neighboring concept.
- Choose a realistic task where Recursion is appropriate.
- Identify a failure mode caused by misusing Recursion.
- Interpret a small design or result involving Recursion.
- Explain one tradeoff or limitation of Recursion.
Documentation and sources
- LLVM Language Reference Manual (llvm.org)