codezonediitj / pydatastructs

A python package for data structures and algorithms
https://pydatastructs.readthedocs.io/en/stable/
Other
202 stars 270 forks source link

Tower of Hanoi #386

Closed Srishti013 closed 3 years ago

Srishti013 commented 3 years ago

The tower of Hanoi is a famous puzzle where we have three rods and N disks. The objective of the puzzle is to move the entire stack to another rod. You are given the number of discs N. Initially, these discs are in the rod 1. You need to print all the steps of discs movement so that all the discs reach the 3rd rod. Also, you need to find the total moves.

It is an important recursion problem and I would like to provide its code in python.

Smit-create commented 3 years ago

Hi @Srishti013, This is a very specific problem. We try to add generalized DS, or algorithm. Please look at : https://github.com/codezonediitj/pydatastructs/issues/343 for more ideas.