Download presentation
Presentation is loading. Please wait.
Published byViolet Osborne Modified over 7 years ago
1
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
2
Hanoi ( 4, 'A', 'B') A B C
3
Hanoi ( 1, 'A', 'B') A B C
4
Hanoi ( 1, 'A', 'C') A B C
5
Hanoi ( 2, 'A', 'B') Hanoi (1, 'A', 'C' ) move ring from 'A' to 'B' Hanoi(1, 'C', 'B' ) A B C
6
Hanoi ( 3, 'A', 'B') Hanoi (2, 'A', 'C') move ring from 'A' to 'B' Hanoi ( 2, 'C', 'B') A B C
7
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.