Tower of Hanoi problem: Move the pile of rings from one peg to another Moving one ring at a time No ring can be placed on top of a smaller ring A B C
Hanoi ( 4, 'A', 'B') A B C
Hanoi ( 1, 'A', 'B') A B C
Hanoi ( 1, 'A', 'C') A B C
Hanoi ( 2, 'A', 'B') Hanoi (1, 'A', 'C' ) move ring from 'A' to 'B' Hanoi(1, 'C', 'B' ) A B C
Hanoi ( 3, 'A', 'B') Hanoi (2, 'A', 'C') move ring from 'A' to 'B' Hanoi ( 2, 'C', 'B') A B C
Hanoi ( 4, 'A', 'B') Hanoi (3, 'A', 'C') move ring from 'A' to 'B' Hanoi ( 3, 'C', 'B') Hanoi ( n, x, y) Hanoi (n-1, x, z) move ring from x to y Hanoi ( n-1, z, y) A B C