I was wondering if anyone had a good simple explanation of how to work out what the result is from a recursive method? For example the following produces 24 as the result when you pass in 4... (1 * 2 * 3 * 4 = 24)
but how would you break it down if presented with this sort of question in an interview?
Another example would be
which will return 28 if you pass in 3 and 4 as the args but again how would you work this out manually? Is there a standard formula for breaking these down?