Understanding recursion

How to know when to solve going towards base case and when coming from base case

@shikhar07 hey basically in every recursion qstn just do these 3 steps:
Write your base case,call recursion and assume that ki recursion ne sahi ans la dia hoga ,aur apni calculation original part pr and in this way you can solve your question ,base case is like terminating condition when recursion go deep and reaches last than base vase is called and recursion return to previous call in stack ,if you want to understand deeply than make call stack wuth function arguments aur jaise hi call complete ho use stack se nikal do and jaise hi call ho stack me dalo and dry run kro.Feel free to askany doubt.

Thanks,recursion is quite daunting for me and thats why the main question is how do you know what you have assumed is correct ,and how to think in the way that the assumption will be correct .

@shikhar07 hey basically we assume it through PMI and there is proof for it ,so just assume that recursion will bring right answer for you and solve the question ,it will be easier for you ,otherwise for proof just dry run the question and after writing recursion and you will get it ki it is giving right answer.

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.