954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Tower Of Hanoi

Can anyone tell me the complete algorithm analysis of Tower of Hanoi for n pegs and n disks.I really need it :sad:

harshchandra
Junior Poster in Training
68 posts since Nov 2004
Reputation Points: 7
Solved Threads: 1
 

>Can anyone tell me the complete algorithm analysis of Tower of Hanoi
Sure:

#include <iostream>

using namespace std;

int main()
{
  cout<<"I'm too lazy to do my own work\n";
  cout<<"I'm too stupid to realize that nobody will do my work for me\n";
  cout<<"I'll never amount to anything because I'm a cheating slacker"<<endl;
}
Narue
Bad Cop
Administrator
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
 

wow... i think i found a site for your "analysis"

www.owned.gg

phr0stbyt3
Newbie Poster
16 posts since Oct 2004
Reputation Points: 10
Solved Threads: 1
 

I went into Google and typed

algorithm analysis of Tower of Hanoi

and it came right up with a bunch of interesting sites.

Chainsaw
Posting Pro in Training
436 posts since Jun 2004
Reputation Points: 36
Solved Threads: 11
 

or just click on the Gooooogle adds that show up in this thread for a lot of hot deals in and about Hanoi :)

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

Whoa! Let's not be this rude please folks. I did a google search for towers of hanoi and a bunch of informative links came up:

http://www.cut-the-knot.org/recurrence/hanoi.shtml
http://mathforum.org/dr.math/faq/faq.tower.hanoi.html

They should answer your question.

cscgal
The Queen of DaniWeb
Administrator
19,422 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 230
 

Hey! That's what I said! I wasn't trying to be rude, just helpful!

Google is a wonderful resource for algorithms.

Chainsaw
Posting Pro in Training
436 posts since Jun 2004
Reputation Points: 36
Solved Threads: 11
 

just trying to make people think for themselves Dani... There's way too much "I don't want to think, I just want a canned solution so I won't fail my test" attitude these days.
If those people graduate without writing code they'll become problems for us as colleagues and we'll end up with more work as we'll have to do their work as well leading to unpaid overtime, missed deadlines, etc. etc.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

Sorry guys for the confusion. I was actually leaning my comment towards Narue. ;)

cscgal
The Queen of DaniWeb
Administrator
19,422 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 230
 

Thanks guys , at last i got the solution.

harshchandra
Junior Poster in Training
68 posts since Nov 2004
Reputation Points: 7
Solved Threads: 1
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You