Base case
The problem so small that a recursive function solves it without calling itself again. It's what makes recursion end.
Example
In the sum f(n) = n + f(n − 1), the base case is f(1) = 1. Without it, f(3) would go on to f(0), f(−1)... forever.
Test yourself: Base case
Iteration and recursion
What is the base case for in a recursive function?
In the sum from 1 to n, the base case f(1) = 1 stops the descent. Without it, f(3) would go on to f(0), f(−1)... forever.
0/1
â–¶ Play