Examlex

Solved

Consider the Following Recursive Sum Method

question 31

True/False

Consider the following recursive sum method:
public int sum(int x)
{
if (x == 0) return 0;
else return sum(x - 1) + 1;
}
If the base case is replaced with if (x == 1) return 1; the method will still compute the same thing.


Definitions:

Process

A series of actions or steps taken in order to achieve a particular end.

Maximal

Pertaining to the highest or greatest possible amount or degree.

Root

The basic cause, source, or origin of something or the fundamental part of a word to which affixes can be added.

Maxim

A concise statement expressing a general truth or rule of conduct.

Related Questions