Code Examples for Recursion Lectures

  1. Calculating the moves necessary to solve a Towers of Hanoi problem.
  2. Calculating Fibonacci numbers, using an efficient and an inefficient recursive solution.
  3. Finding a pot of gold within a simple maze, using a backtracking, recursive strategy. This consists of two classes, MazeWalker, and Maze. The Maze code given here is not complete, but only outlines what methods the class should provide to enable MazeWalker.