Purchase Solution

recursive method

Not what you're looking for?

Ask Custom Question

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.

public int sum( int n )
{
if ( n == 0 )
return 0;
else
return n + sum( n );
} // end method sum

Purchase this Solution

Solution Summary

It finds and corrects the erros in the recursive method. The response was rated '5/5' by the student who originally posted the questions.

Purchase this Solution


Free BrainMass Quizzes
C++ Operators

This quiz tests a student's knowledge about C++ operators.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

C# variables and classes

This quiz contains questions about C# classes and variables.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.