Recursion
For question 1, type the answers in a text or word document andsubmit them in the dropbox with your name included.
1. Consider the following method:
public static int mystery4(int x, int y) {
if (x < y) {
return x;
}
else {
return mystery4(x – y, y);
}
}
For each of the following method calls, how many distinct callsare made to the mystery4 method and what are the values of x and yfor each distinct call? What value is returned?
(a) mystery4(6, 13);
(b) mystery4(8, 2);
(c) mystery4(37, 10);
Expert Answer
Answer to Recursion For question 1, type the answers in a text or word document and submit them in the dropbox with your name incl…