Examples of recursion in the following topics:
-
Sequences
- Sequences whose elements are related to the previous elements in a straightforward way are often specified using recursion.
- To specify a sequence by recursion requires a rule to construct each consecutive element in terms of the ones before it.
- The Fibonacci sequence can be defined using a recursive rule along with two initial elements.