This is a classic problem, but a really nice one. We want to solve the Hanoi Tower problem:
“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).” Geeksforgeeks
- You will need to formulate and sketch the solution for this problem with 3
- Using either BFS or DFS (choose one), create the code for the solution for n disks (worst case scenario submit the pseudo-code).