Send
Close Add comments:
(status displays here)
Got it! This site uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website.nbsp; Note: This appears on each machine/browser from which this site is accessed.
Towers of Hanoi
1. Towers of Hanoi
2. Towers of Hanoi
Rules for the Towers of Hanoi problem:
Move the disks from pole 1 (left) to pole 3 (right).
Only one disk can be moved at a time.
A larger disk cannot be placed on a smaller disk.
All disks except the one being moved must be on a peg.
3. Problem solving
How do we solve this puzzle? (to see how computer scientists think)
Divide and conquer, recursively.
Reduce problem size by half at each step: fast solution.
Reduce problem size by 1 at each step: slow solution.
Top-down backward-chaining way to think about the problem.
Bottom-up forward-chaining does not work well (may need extra work, may not reach goal)
4. Towers of Hanoi game
5. Towers of Hanoi game
6. Towers of Hanoi
The Towers of Hanoi problem shows how a small program can be used to solve a seemingly complicated problem. The key is to divide the problem into smaller parts, solve each turn, and combine the solutions to solve the overall problem.
7. End of page