Solved

Consider the Following Definition of a Recursive Method

Question 2

Multiple Choice

Consider the following definition of a recursive method.public static int strange(int[] list, int first, int last)
{
If (first == last)
Return list[first];
Else
Return list[first] + strange(list, first + 1, last) ;
}Given the declarationint[] beta = {2, 5, 8, 9, 13, 15, 18, 20, 23, 25};What is the output of the following statement?System.out.println(strange(beta, 4, 7) ) ;


A) 27
B) 33
C) 55
D) 66

Correct Answer:

verifed

Verified

Related Questions