The first two times it's called the first if loop is triggered. The next 2 times it's called, the second loop is triggered and the same thing is being done to b that was done to a. The final time it's called it will return the final else statement.
so the calls will run like this, if my logic is not mistaken
PS: Make sure you've written it out EXTENSIVELY; don't just write down values step by step, write down each STEP step by step WITH the values in place;if you still cant figure it out, here's what it looks like. But again, make sure that you've tried it step by step through the code.
Did you try to understand what the if and else statements try to do?
------------------
Code:
r(5,3)
5>3 so return 5*r(4,3)
4>3 so return 4*r(3,3)
3 does not > 3 so go to second statement
3>1 so return 3*r(1,2)
1 does not > 2 so go to second statement
2>1 so return 2*r(1,1)
1 does not >1 so go to second statement
1 does not > 1 so go to third statement
return 1
2*1
3*2*1
4*3*2*1
5*4*3*2*1
Tada.