Saicharan67 / Interview-Coding-Questions

11 stars 10 forks source link

Create iterative tower of hanoi #20

Closed hyderr closed 2 years ago

hyderr commented 2 years ago

The Tower of Hanoi is a mathematical puzzle. It consists of three poles and a number of disks of different sizes which can slide onto any poles. The puzzle starts with the disk in a neat stack in ascending order of size in one pole, the smallest at the top thus making a conical shape. The objective of the puzzle is to move all the disks from one pole (say ‘source pole’) to another pole (say ‘destination pole’) with the help of the third pole (say auxiliary pole).

The puzzle has the following two rules:

  1. You can’t place a larger disk onto a smaller disk
  2. Only one disk can be moved at a time
Saicharan67 commented 2 years ago

Try to come up with your own work at least