Start here · Essential guide
Recursive Functions in C++
A recursive function calls itself to solve smaller parts of a problem. Learn the base case, the recursive case, examples in C++ and when to use recursion.
Syntax and Functions
How recursive functions work, why they need a base case and how they look in Python.
Start here · Essential guide
A recursive function calls itself to solve smaller parts of a problem. Learn the base case, the recursive case, examples in C++ and when to use recursion.
A base case is the condition where a recursive function stops calling itself and returns a value. Learn how to write one and avoid infinite recursion.
A recursive function in Python calls itself with a smaller input until a base case stops it. See a working example, the recursion limit and a C++ comparison.
Recursion is when a function calls itself. This guide shows a C example that computes factorials, traces each call and explains why a base case is needed.
Recursion is the technique, and recursive describes something that uses it, such as a recursive function. Here is how to use each word in C++.
Related topics