Functions that call themselves
Recursion is a programming technique where a function calls itself to solve a problem by breaking it down into smaller, similar subproblems. A recursive function typically has two parts: a base case that provides the solution for the simplest instance of the problem, and a recursive case that breaks the problem down and calls itself with modified arguments. Recursion is particularly useful for problems that have natural recursive structure, such as tree traversal, mathematical sequences (Fibonacci, factorial), divide-and-conquer algorithms, and problems that can be defined in terms of themselves. However, recursion can be less efficient than iterative solutions due to function call overhead and may lead to stack overflow errors for deep recursion. Python has a recursion limit (typically 1000) to prevent stack overflow. Some problems are more naturally expressed recursively, while iterative solutions may be more efficient. Understanding when and how to use recursion is an important skill in algorithm design.