Tower of Hanoi Algorithm

Start Timer

0:00:00

Upvote
1
Downvote
Save question
Mark as completed
View comments (3)

The Tower of Hanoi is a mathematical puzzle that consists of three rods and several discs of different sizes that can slide onto any rod. The puzzle starts with all the discs stacked on a single rod, the smallest disc at the top, making a cone shape.

The object of the puzzle is to move the entire stack to another rod, obeying these rules:

  1. Only one disc can be moved at a time.
  2. Each move consists of taking the upper disc from one of the stacks and placing it on top of another stack or an empty rod.
  3. No larger disc may be placed on top of a smaller disc.

With these rules in mind, how would you approach solving the puzzle if there are three discs on the leftmost rod and your goal is to move them all to the rightmost rod?

.
.
.
.
.


Comments

Loading comments