Hello! I am struggling to understand recursive tracing in the follow scenario (code given below). I realize recursion has two cases - a base case, and a recursive case, which recalls the method. For example, given the following code:
Test(3) goes like this:
Test(3) evaluates to ? ---> test(2) evaluates to ? --- test(1) evaluates to 1, so now go back, up the chain.
We were given the following method as a class example, however I don't understand what two recursive calls, stacked on top on one another, behave like.
Upon running this code i know it prints "1, 2, 3, 4, 5" which
almost makes sense to me but something is just not quite clicking. To be clear, this is for a class but is not a homework problem, just an example that was in the notes that I do not understand.
Thanks for any help!