I am trying to get a good handle on recursion since it’s recommended knowledge for my algorithm class. I’ve been doing code tracing to get some better understanding of how to read and write recursive algorithms, but I find that some of the time I miss out on the relationships between the different calls to the stack. I’m hoping someone can help me further my knowledge into how the stack plays a role in recursive algorithms.
#trying to get a grasp on recursion through code tracing but still have some knowledge gaps
9 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @rare swallow! Please use
/closeor theClose Postbutton above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
I will send an example of code tracing I just did
Excuse the mess
I’m working on problem 2 on the page
The answer turned out to be that you were supposed to combine all results on the stack times 2
However based on what I thought the internal result of each layer in the stack is independent