Click here to Skip to main content
13,355,538 members (75,858 online)
Click here to Skip to main content
Add your own
alternative version


14 bookmarked
Posted 29 Feb 2004

Recursive Tower of Hanoi with(GUI)

, 29 Feb 2004
Rate this:
Please Sign up or sign in to vote.
Recursive Tower of Hanoi with(GUI)


According to the legend of the Tower of Hanoi (originally the "Tower of Brahma" in a temple in the Indian city of Benares), the temple priests are to transfer a tower consisting of 64 fragile disks of gold from one part of the temple to another, one disk at a time. The disks are arranged in order, no two of them the same size, with the largest on the bottom and the smallest on top. Because of their fragility, a larger disk may never be placed on a smaller one, and there is only one intermediate location where disks can be temporarily placed. It is said that before the priests complete their task the temple will crumble into dust and the world will vanish in a clap of thunder.

Does this make mathematical sense?

In the classic math problem, there are three posts. Disks of different sizes (call the number of disks "n") are placed on the lefthand post, arranged by size with the smallest on top. You are to transfer all the disks to the righthand post in the fewest possible moves, without ever placing a larger disk on a smaller one. One move is considered to be moving one disk from one post to another post.




This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Web Developer
Egypt Egypt
No Biography provided

You may also be interested in...

Comments and Discussions

QuestionUmm, where is the rest of the article? Pin
DavidCrow2-Mar-04 3:40
memberDavidCrow2-Mar-04 3:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.180111.1 | Last Updated 1 Mar 2004
Article Copyright 2004 by ssm_as
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid