• anonymous
in the sixth lecture : recursion about 24:40, the professor was trying an example with a tower of hanoi so he wrote: Code: def hanoi(n,f,t,s): if n == 1: print 'move from ' +f +' to ' +t else: hanoi(n-1,f,s,t) hanoi(1,f,t,s) hanoi(n - 1,s,t,f) which i didn't understand it because according to my understanding it if n equal 1 it will print : print 'move from ' +f +' = ' +t, and then exit the functionand if n doesn't equal 1 it will keep calling the fist call in the else dent : hanoi(n-1,f,s,t) only and not printing anything until n became
MIT 6.00 Intro Computer Science (OCW)
• Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Looking for something else?

Not the answer you are looking for? Search for more explanations.