Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: Recursion: the Towers of Hanoi problem

by pg (Canon)
on Oct 19, 2004 at 01:40 UTC ( #400378=note: print w/ replies, xml ) Need Help??

in reply to Recursion: The Towers of Hanoi problem

This is a real beauty. In this case, without recursion, you have to use something like stack to rememeber all the steps you went through, and for an average person, it wold take you quite some time to make the stack right, when to push, when to pop...

With recursion, the REAL code is only about 4 or 5 lines long.

This could even be viewed as sort of AI program, but the solution is definite.

Comment on Re: Recursion: the Towers of Hanoi problem

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://400378]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (10)
As of 2015-11-30 09:46 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (769 votes), past polls