Recursion – Algorithms

Programming languages support recursion. In a recursive program a function calls itself to solve smaller subproblems. When you write a recursive program you are applying abstraction: ignoring how smaller subproblems are solved in order to solve the big problem.

We present a number of recursive algorithms. Some relate to problems already covered in other blog entries (primarily on loops and functions). For the first two examples, Towers of Hanoi and Tiling with Trominos, we describe recursion solutions in a visual way, but provide no programs. Describing recursive algorithms without programs is often not as effective and we provide programs for most other examples.

See http://openbookproject.net/thinkcs/python/english3e/recursion.html for additional recursive Python programs with a good discussion on recursion.