'Deallocation of Memory for Recursion

We all know that a certain amount of memory is allocated when a function is calling itself recursively. So how can we deallocate that whole memory and return to the main function ? Also, wanted to know that how can we return from a recursion immediately to the calling function?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source