SUNY Geneseo Department of Computer Science
{Date}
CSci 141, Spring 2005
Prof. Doug Baldwin
Section 6.1
If you need to repeat steps you can call a method from itself (recursion)
Breaking large problems into smaller versions of the large problem
Eventually reach trivial step
The Towers of Hanoi
Rules
Try to devise an algorithm for solving the puzzle for any number of disks, and then describe that algorithm
Ideas
Or
Or
This has a concise description as a recursive algorithm. See Program that solves the puzzle.
Some examples from the text -- in what ways are their control structures similar?
Designing Recursive Algorithms
Read Sections 6.2 and 6.3