Multiple Choice
Consider the helper method reversePrint, which uses recursion to display in reverse the elements in a section of an array limited by the firstIndex and lastIndex arguments. What statement should be used to complete the recursive method? public static void reversePrint(int[] array, int firstIndex, int lastIndex)
{
If (firstIndex < lastIndex)
{
________________________________________
}
System.out.println(array[firstIndex]) ;
}
Public static void main(String[] args)
{
Int [] numbers = { 4, 7, 1, 0, 2, 7 };
ReversePrint(numbers, 0, numbers.length - 1) ;
}
A) reversePrint(array, firstIndex, lastIndex + 1) ;
B) reversePrint(array, firstIndex, lastIndex - 1) ;
C) reversePrint(array, firstIndex + 1, lastIndex - 1) ;
D) reversePrint(array, firstIndex + 1, lastIndex) ;
Correct Answer:

Verified
Correct Answer:
Verified
Q99: Complete the following code snippet, which is
Q100: Consider the fib method from the textbook
Q101: Recursion will take place if any of
Q102: Consider the fib method from the textbook
Q103: Consider the recursive square method shown below.
Q105: Consider the mutually recursive methods below. Select
Q106: Consider the recursive method myPrint in this
Q107: Given the following class code: public class
Q108: Consider the recursive method shown below: public
Q109: Consider the iterative version of the fib