Learn C++ in step-by-step lessons.
Recursion
Recursion is when a function calls itself. For recursion to work there has to be a trivial case where the recursion ends.
Try to identify the trivial case in each example.
Goals:
- Be able to understand and use recursive functions
Objectives:
- Be able to understand and trace a recursive function
- Be able to write a recursive function
Please study the material at each of the links below.
Understanding recursion- Find half of a number recursively
The Towers Problem- Fibonacci Sequence
Glossary for recursion lesson
Full Glossary