An algorithm is a sequence of steps, including at least 1 terminating step, for solving a problem. A recursive algorithm is an algorithm that breaks the problem into smaller subproblems and applies the algorithm itself to solve the smaller subproblems.

Because a problem cannot be endlessly divided into smaller subproblems, a recursive algorithm must have a base case: A case where a recursive algorithm completes without applying itself to a smaller subproblem.

A recursive function is a function that calls itself. Recursive functions are commonly used to implement recursive algorithms.