We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I belive what Brynn is saying is that the process of recursion creates a stack whether or not you are using a stack data structure to store data.
Basically, each time you recurse, you're putting the current call of the function on hold and making a new call to the function. Then, once you hit the base case, you start going down the list of functions in a Last In, First Out manner, because the VM has created a stack of your function calls to process later while you were recursing.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Largest Rectangle
You are viewing a single comment's thread. Return to all comments →
I belive what Brynn is saying is that the process of recursion creates a stack whether or not you are using a stack data structure to store data.
Basically, each time you recurse, you're putting the current call of the function on hold and making a new call to the function. Then, once you hit the base case, you start going down the list of functions in a Last In, First Out manner, because the VM has created a stack of your function calls to process later while you were recursing.