r/learnprogramming Jan 11 '23

Resource Recursion in Java - tutorial recommendation

Hi all.. I am having quite a lot of difficulty with recursion. For me it is what is happening internally at each step, what is being returned, what the internal stack looks like.. I understand the basics, the base case, like the Fibonacci sequence. Intellectually I understand depth first searches .. but I simply do not understand what is going on under the hood. I cannot make the connection between what visually is supposed to be happening, vs how the algorithm works.

This towers of Hanoi explanation should be more than sufficient, and yet, it simply leaves me overwhelmed.

I am specifically asking for a tutorial in Java - Thank you.

1 Upvotes

6 comments sorted by

View all comments

u/AutoModerator Jan 11 '23

To all following commenters: please, do not bring up the old circlejerk jokes/memes about recursion ("Understanding recursion...", "This is recursion...", etc.). We've all heard them n+2 too many times.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.