Functions & Programming Concepts · Level 2 of 5
Recursive Function
A function defined using calls to itself, directly or indirectly.
A base case or other termination argument is needed to avoid unbounded recursion.
Example
A factorial routine reduces its argument until reaching one.
Listen to the definition and example
Audio transcript
Recursive Function. A function defined using calls to itself, directly or indirectly. A base case or other termination argument is needed to avoid unbounded recursion. For example: A factorial routine reduces its argument until reaching one.
Explore this concept
Why it matters
This helps you distinguish a computation’s contract, inputs, outputs, and behavior.
Start with
Related concepts
Quick recall question
Try answering before looking back at the definition.