I am a beginner in data structures and algorithms and recently came across the tower of hanoi algorithm. I see a clash that i can't figure out between the rules of tower of hanoi (recursion method) and the standard way the clash is:
According to the standard rules:
- only one disk can be moved among the towers at any given time.
- Only the "top" disk can be removed.
- No large disk can sit over a small disk.
BUT according to the recursive method:
- Move n-1 disks from source to aux.
- Move nth disk from source to destination.
- Move n-1 disks from aux to destination.
as you can see, there's a difference between the 1st and 2nd rules of both the methods.