5
How it works
The Towers of Hanoi is a classic mathematical puzzle with three rods and disks of different sizes. The objective is to move the entire stack from rod 1 to rod 3, following these rules:
- Only one disk can be moved at a time.
- Only the top disk of a stack may be moved.
- No larger disk may be placed on top of a smaller disk.
Adjust the slider to change the number of disks and watch the algorithm solve it step by step. A solution for n disks requires exactly 2ⁿ − 1 moves.