Lesson 5 of 819607 min
Recursion
In April 1960 Communications of the ACM published John McCarthy's paper "Recursive Functions of Symbolic Expressions and Their Computation by Machine, Part I". It described a language in which programs were built almost entirely from functions that call themselves. That language was Lisp.
Most programmers meet recursion as a trick for computing factorials. It is more than that: it is the natural way to process anything defined in terms of itself, such as a folder that contains folders, an arithmetic expression, or a tree.
The rest of this lesson is part of Pro
Create a free account to read the first lesson of every path, and go Pro for the rest.
Sources
- Recursive Functions of Symbolic Expressions and Their Computation by Machine, Part I (J. McCarthy, 1960) — John McCarthy, Stanford University
- sys.setrecursionlimit — Python documentation
- functools.lru_cache — Python documentation