Ask your own question, for FREE!
MIT 6.001 Structure and Interpretation of Computer Programs, Spring 2005 13 Online
OpenStudy (anonymous):

I didn't understand the recursive algorithm used in the Hanoi Towers. Can anyone help me out? I didn't understand the recursive algorithm used in the Hanoi Towers. Can anyone help me out? @MIT 6.001 Structu…

OpenStudy (anonymous):

Help yourself! I think you should get DrRacket ( http://racket-lang.org/) and then use its debugger to see what's going on step-by-step. Please find attached a sample program to get you started. Copy and paste it in the upper definition editor. Click the "Debug" button - the one near the bomb icon LOL. While in debug mode try to solve a 1,2 or 3 dimension problem by typing in the lower interaction window one of the following expression: (move 1 1 2 3) (move 2 1 2 3) (move 3 1 2 3) Use the Step button and watch how the stack and the variables change in the right pane. Good luck!

OpenStudy (anonymous):

OpenStudy (anonymous):

Hi Ninuzzo. I have already followed your reply but I´ve got lost after the firs iteration because the variables value change and I can´t understand the logic behind. This are the values I get for a two high tower (move 2 1 3 2) 2 1 3 2 #f 1 1 23 # f 0 1 2 3 display move 1 2 Now the variable change and I can´t understand why 1 1 2 3 0 3 2 1 # t 2 1 3 2 !!!!

OpenStudy (anonymous):

I got a little confused also because he seemed to be using tower for spike and spike for tower during the lecture. I am going to watch some YouTube videos on Hanoi Tower and then watch the lecture portion again before I try to code this one.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!