Recursive Algorithm


Most common solution to the problem is recursive.

procedure:
hanoi(n, A, B) if n - 1 then move disk from A to B else hanoi(n - 1, A, C) move disk from A to B hanoi(n - 1, C, B)
Previous Slide
Next Slide




1