I have just been studying the concept of recursion and I thought that I would try a simple example. In the following code, I am attempting to take the numbers: 1, 2, 3, 4, 5, an
Your code executes as follows:
Sum --> 5 Sum --> 4 Sum --> 3 Sum --> 2 Sum --> 1 Sum --> 0 1 <--- 2 <--- 4 <--- 7 <--- 11 <--- 16 <---
Check your base case.