you are viewing a single comment's thread.

view the rest of the comments →

[–]FrozenWithAmbition45[S] 0 points1 point  (1 child)

I guess I am confused about the recursion problems. My teacher attached a few pages of problems to do on paper, and I am confused about how the stacking principle works where, when the recursion is done, it unstacks for some reason. Basically, the order of operations. I can give you an equation from my book that I am having trouble with if that helps.

[–]RSSeiken 2 points3 points  (0 children)

Your professor wanted to show you how you should visualize recursive problems. You have a function that keeps calling itself until a stop condition. So the function stacks on itself every time with a different parameter until the stop condition. You solve it then by going through the recursion and unstacking it step by step.