Computer Science, asked by gurmangrewal9661, 10 months ago

Consider the extended tower of hanoi, in which each move must involve the auxiliary tower.

Answers

Answered by rajuramuchacha
0

Answer:

we assume that the problem has been solved for n-1 rings that are currently in A and B. That means they are all moved to C and C have 2n-2 ordered rings. After that we have to handle the remaining rings in A & B. That means we have to take smaller ring and place it on the bigger ring (from B to A). After that we have to merge the rings in C (2n-2) and the rings in A (2). Finally we have to use standard Hanoi solution to reach our goal and move all of the rings to C.

Explanation:

Rules

1. Only one disk can be moved at a time.

2. No disk may be placed on top of a smaller disk.

3. The output should contain the necessary moves, not the minimum necessary moves

4. The total number of disks may be even or odd.

5. Implementation should be recursive.

Similar questions