i am not able to understand how the elements get removed from the stack once the code reaches its base case
Removing elements from stack
when a particular function hits a base case it is removed from stack…the control goes to the next line of the function which had called it…in that function there is one line left to execute that is to print (n)…thus the entire work of that function is done…hence it is removed from the stack
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.