-
Notifications
You must be signed in to change notification settings - Fork 7
Tower Of Hanoi #6
Copy link
Copy link
Open
Labels
coulCode_for_UpstartLeagueCode_for_UpstartLeagueenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
Metadata
Metadata
Assignees
Labels
coulCode_for_UpstartLeagueCode_for_UpstartLeagueenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Tower of Hanoi is a mathematical puzzle where we have three rods and n disks. The objective of the puzzle is to move the entire stack to another rod, obeying the following simple rules:
a) Only one disk can be moved at a time.
b) Each move consists of taking the upper disk from one of the stacks and placing it on top of another stack i.e. a disk can only be moved if it is the uppermost disk on a stack.
c) No disk may be placed on top of a smaller disk.
Write a recursive Python function to solve Tower of Hanoi problem. Also, show a step by step
procedural diagram followed in Tower of Hanoi for 4 disk.