A recursive action calls itself
Recursion is a function calling itself to solve a smaller version of the same problem.
Every recursive action needs a base case: a condition simple enough to answer directly, without calling itself again. Without one, the calls would never stop.
- Every recursive ACTION needs a base case that stops it.
- Each call should work on a smaller version of the problem.
- Without a base case, recursion repeats forever, like a loop with no stopping condition.
- It is another way to repeat work, alongside loops.