wisconsin
Recursion

Recursion

Curated by Last modified: 1 min read

Recursion is a technique in programming where a function calls itself in order to solve a problem. Recursion is a powerful tool that can be used to solve complex problems in a simple way.

Solving Recursion Problems

When solving recursion problems, it is important to keep the following steps in mind:

  1. Identify the base case: The base case (trivial solutions) are the simplest form of the problem that can be solved directly without recursion. It is the stopping condition for the recursion.
  2. Recursive Leap of Faith: Assume that the recursive call works correctly and solves the problem for a smaller input size.
  3. Recombination: Use the results of the recursive call to solve the problem for the current input size.

Source

The existing course note was retained and normalized during the merge.

Related: Topic index.

Linked to this page