Tougher example:Fibonacci function: int fib(int n) { if (n == 0) return 0; if (n == 1) return 1; return fib(n-1) + fib(n-2); } Recursive tree: helps in visualization of recursion call and helps to understand how recursion stored in stack memory. When do we need recursion?R...
In that span of time , I solved problems from GFG, hackerrank , hackerearth, UVA online judge, leetcode, interviewbit, codeforces etc. You get what i am trying to say. Hunt problems of recursion and kill them. xD Recursion will become one of your strong topic in no time. Best of ...