Question: Write an C program with the recursive implementation of the popular logic puzzle Tower of Hanoi. The tower of Hanoi is defined as follows: There
Write an C program with the recursive implementation of the popular logic puzzle "Tower of Hanoi". The tower of Hanoi is defined as follows: There are three stacks of plates, whereby the first stack is pre-filled with plate sizes sorted in descending order (see graphic) The tiles should be moved from this first stack to the last rightmost stack by observing the following rules: o Exactly one tile is moved from one stack to another stack per "move". o Smaller slabs may be placed on top of larger slabs o Larger slabs must not be placed on top of smaller slabs o Only the top tile of a stack can be moved (i.e. the one that was last placed on this stack) You may assume that there are exactly three stacks and five tiles. As you read through the principle of moves, consider what dynamic data structure you might be able to use for this task.
An output example of the program:


Stack 1: *t*t *kt*k Stack 2: Stack 3: Stack 1: k Stack 2: Stack 3: * Stack 1: Statt *k*k* Stack 2: * ** Stack 3: Stack 1: t*kt Stack 2: * Stack 3: Stack 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
