Question: Re-write the following as a recursive method. **** * * get Sum Return the sum of all positive integers 1 thru n For example getSum
Re-write the following as a recursive method.

**** * * get Sum Return the sum of all positive integers 1 thru n For example getSum (4) = 1 + 2 +3 + 4 = 10 * @parameter n indicating number of positive integers @return sum * *********** **** */ private int getSum(int n) int result = 0; for (int i =1; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
