Help: Tower of Hanoi.
Author Message
Help: Tower of Hanoi.

Anyone wrote a program for the Tower of Hanoi problem.
Tower of Hanoi is where you have three pegs with nth
numbers of rings on them in increasing size. You have to
tranfer those rings into the next peg by only transferring one at a
time.
If anyone encountered this problem, can you please reply ASAP.

Wed, 18 Jun 1902 08:00:00 GMT
Help: Tower of Hanoi.

Quote:

>Anyone wrote a program for the Tower of Hanoi problem.
>Tower of Hanoi is where you have three pegs with nth
>numbers of rings on them in increasing size. You have to
> tranfer those rings into the next peg by only transferring one at a
>time.
>If anyone encountered this problem, can you please reply ASAP.

Tower of Hanoi is covered in a number of the text books you'll find at the
college library.  But it's used as a demonstration of the power of recursion.
The problem, "Move n disks from here to there," breaks down into a recursive
application of the simplest case -- "move 1 disk."

There's an important idea to be learned here and I encourage you not to grab
for a canned solution too quickly.  All kinds of problems can be solved this
way.

/mr/

Wed, 18 Jun 1902 08:00:00 GMT
Help: Tower of Hanoi.
That was our problem in CS 152 last week we called a recursive procedure
that will solve the problem for any number of disks. (but be careful the
number of moves is 2^n-1 so it gets big fast!)
A hint break it down(the problem so that it can solve for one or two
disks) then you can solve for any number

Wed, 18 Jun 1902 08:00:00 GMT
Help: Tower of Hanoi.
Hello Josecita!

JM> Anyone wrote a program for the Tower of Hanoi problem.
JM> Tower of Hanoi is where you have three pegs with nth
JM> numbers of rings on them in increasing size. You have to
JM>  tranfer those rings into the next peg by only transferring one at a
JM> time.
JM> If anyone encountered this problem, can you please reply ASAP.

This smells like an assignment, why don't you ask for the algorithm and
implement it yourself, rather than relying on us to provide you with a working
source?

Regards Mikkel Breiler Cosysop Renoz BBS, Vinyl/Intuition

Wed, 18 Jun 1902 08:00:00 GMT

 Page 1 of 1 [ 4 post ]

Relevant Pages

Powered by phpBB® Forum Software