Nov 1, 2018

Recursion rules

Recursion has two simple rules:

  1. Each recursive call should be on a smaller instance of the same problem, that is, a smaller subproblem.
  2. The recursive calls must eventually reach a base case, which is solved without further recursion.