Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 21st, 2006, 3:08 PM   #1
ergawy
Newbie
 
Join Date: Feb 2006
Posts: 7
Rep Power: 0 ergawy is on a distinguished road
does anybody know how to solve this problem

Can you find a solution for the 4 needle towers of hanoi problem according to these rules:
• First move the topmost discs (say the top k discs) to one of the spare needles.
• Then use the standard three needles strategy to move the remaining
n − k discs (for a general case with n discs) to their destination.
• Finally, move the top k discs into their final destination using the four needles.

thanks in advance
ergawy is offline   Reply With Quote
Old Feb 21st, 2006, 3:16 PM   #2
MBirchmeier
Hobbyist Programmer
 
Join Date: Oct 2005
Posts: 211
Rep Power: 3 MBirchmeier is on a distinguished road
Quote:
Originally Posted by ergawy
Can you find a solution for the 4 needle towers of hanoi problem according to these rules:
• First move the topmost discs (say the top k discs) to one of the spare needles.
• Then use the standard three needles strategy to move the remaining
n − k discs (for a general case with n discs) to their destination.
• Finally, move the top k discs into their final destination using the four needles.

thanks in advance
Yup... I know how to solve the problem... do you?

you might want to read up on how to ask a question here

-MBirchmeier
MBirchmeier is offline   Reply With Quote
Old Feb 21st, 2006, 3:36 PM   #3
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Hint: Recursion makes this easier.
Arevos is offline   Reply With Quote
Old Feb 21st, 2006, 3:50 PM   #4
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
Please tell me you tried to code this yourself first, obviously this is a homework assignment. What have YOU done?
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Feb 21st, 2006, 5:55 PM   #5
TCStyle
Programmer
 
Join Date: Jan 2005
Location: Albany, NY
Posts: 43
Rep Power: 0 TCStyle is on a distinguished road
...

This may be of interest:
http://www.csee.umbc.edu/331/fall00/homework/hw4/
__________________
meh...
TCStyle is offline   Reply With Quote
Old Feb 22nd, 2006, 2:37 AM   #6
pal
Programmer
 
pal's Avatar
 
Join Date: Mar 2005
Location: Washington
Posts: 91
Rep Power: 4 pal is on a distinguished road
I recommend you using the best of your logic and wisdom.
References can definately be found on the Internet, but I also recommend you to write it out yourself first and then post up the code if there are any detailed technical problems that you need to ask.
pal is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:20 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC