3 ms·
This is exactly the point where many people get hung up. They cannot proceed to reading the next line until they understand how the recursive call works. ...wh
by userbinator 9y ago
This is exactly the point where many people get hung up. They cannot proceed to reading the next line until they understand how the recursive call works.
...which is why you should always teach recursion by starting with the base case and build on it with a recursive call, not the other way around. Step through an example execution of the algorithm with no recursive calls --- only the base case. Then step through with one or two levels of recursive calls, and they'll usually start seeing the pattern of how it works (and be able to generalise to n levels.)