Chapter 15: Problem 8
Find the error(s) in the following recursive method, and explain how to correct it (them). This method should find the sum of the values from 0 to n. 1 public int sum( int n ) 2 { 3 if ( n == 0 ) 4 return 0; 5 else 6 return n + sum( n ); 7 } // end method sum
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.