Multiple Choice
In the following code that uses recursion to find the greatest common divisor of a number, what is the base case? public static int gcd(int x, int y)
{
If (x % y == 0)
Return y;
Else
Return gcd(y, x % y) ;
}
A) gcd(int x, int y)
B) if (x % y == 0)
Return y;
C) else
Return gcd(y, x % y) ;
D) Cannot tell from this code
Correct Answer:

Verified
Correct Answer:
Verified
Q1: Recursion is never absolutely required to solve
Q2: In the following code that uses recursion
Q3: When recursive methods directly call themselves, it
Q4: Given the following code that uses recursion
Q6: In the _, the problem must be
Q7: To use recursion for a binary search,
Q8: The _ is at least one case
Q9: A method is called from the main
Q10: Any problem that can be solved recursively
Q11: Without a base case, a recursive method