- what is recursion?
repeat a process in a self-similar manner.
- in programming language
For example, if two mirrors are put parallel with each other, the nested images that occur are a form of infinite recursion.
In computer science, it refers to a way of defining function in which the function being defined is applied within itself.
The function needs to set branch condition so that call times of the function is not infinite.
How to avoid the possibility of endless loop.
sometimes recursion is used along with backtrack. - in definition
define a concept in a recursive manner means that we use the definition with smaller size or scale but with the same essence(intrinsic quality).
For instance, binary search tree, binary tree, tree, etc***( to be continued)* . In math, closure, natural numbers. - recursive optimization
dynamic programming - function
Fibonacci function: either iterative or recursively is OK
Ackermann function: cannot be easily expressed without recursion - structural induction
a powerful generalization of mathematical induction widely used in mathematical logic and computer science - factorial
- in programming language