Mark As Completed Discussion

Recursion Tree for Hanoi

Figure below shows the recursion tree for a 3 disk problem

Recursion Tree For HanoiFigure Below Shows The Recursion Tree For A 3 Disk Problem

Collect together all the shift moves to have the final solution:

Recursion Tree For HanoiFigure Below Shows The Recursion Tree For A 3 Disk Problem

Attached is the beautiful recursive code for Towers of Hanoi done in C++ using the pseudo-code given previously. As you can see, it is a direct translation of the pseudo-code we wrote beforehand.

JAVASCRIPT
OUTPUT
:001 > Cmd/Ctrl-Enter to run, Cmd/Ctrl-/ to comment