Programming - Concept
Recursion
When a function solves a problem by calling itself with a smaller or simpler version of it
What's it for?
Provides a compact way to handle problems that naturally break into repeated smaller versions of themselves.
For example…
A program counts down from five by repeatedly calling the same function with a number one smaller until it reaches zero — a simple use of recursion