the.com/recursion
A function that solves a problem by asking a smaller version of itself.
means A process that solves a problem by calling a smaller copy of itself until it reaches a case simple enough to answer directly.
from From Latin recursio, 'a running back,' built from re- ('back, again') plus currere ('to run') — the same root that gives us 'current' and 'course.' The term was carried into mathematics and logic in the early 20th century to describe definitions that refer to themselves, then picked up by computer science mid-century for functions that call themselves — the word literally runs back on itself, which is on the nose for once.
- base case
- skip it and you get infinite calls, then a crash
- classic example
- factorial, fibonacci, and folder file-searching
- hidden cost
- every call stacks memory until it returns
- joke status
- to understand recursion, see recursion