ll solve(ll n)
{
if(n==0 or n==1)
return n;
ll sum=0;
sum=sum+n;
solve(n-1);
return sum;
}
and
ll solve(ll n)
{
if(n==0 or n==1)
return n;
ll sum=0;
sum=sum+n+solve(n-1);
return sum;
}
please tell me how these two function work differently and how the call stack work in the two cases. please help i am highly confused