`sum(arr, n)`

here, n refers to the index of arr…

when `n==1`

it’ll return first element + zero(n-1==0), thus terminating the recursion

`sum(arr, n)`

here, n refers to the index of arr…

when `n==1`

it’ll return first element + zero(n-1==0), thus terminating the recursion

7 Likes