Correctness of recursive methods
However, to understand that a particular recursive method is correct, you should not think about executing it. Rather, do two things:
Understand that each recursive method call is correct in terms of the specification of the method.
Make sure that the recursion “terminates” (much like making sure that a loop terminates). That is, see to it that in some sense the arguments of the recursive call are “smaller” than the parameters of the method and that when the parameters are “as small as possible”, the method terminates without calling itself recursively. We’ll see this in the examples.