Understanding how a recursion really works (recursion from the ground up)
If you're into programming and really have problem on such algorithm that you wanted to implement, however requires a recursive call (or can be an iterative call --but we'll discuss on recursion for this topic). Take note on recursion that they are, using much more memory than using iteration because it copies or clones the elements in the function that tries to recurse. So it makes new copies of: the code local variables with its initial variables paramaters it's more expensive as it retains clones into the memory which I am pertaining the variables, params, code in the stack it's usually slower due to overhead in maintaining the stack Each copy of the code includes a marker indicating the current position. When a recursive call is made, the marker in the old copy of the code is just after the call; the marker in the "cloned" copy is at the beginning of the method. When the method returns, that clone goes away, but the previous ones are still t...