Q41. private int func3(int m, int n) {
if (m < n)
return 0;
else
return 1 + func3(m-n, n);
}
Refer to the code above. What is the value of func3(-5, 1)?
a. -5
b. 0
c. 1
d. 5
Q50. private int func1(int m, int n) {
if (m==n || n==1)
return 1;
else
return func1(m-1,n-1) + n*func1(m-1,n);
}
What precondition must exist in order to prevent the code above from infinite recursion?
a. m > = 0 and n >= 0
b. m >= 0 and n >= 1
c. m >= 1 and n >= 0
d. m >= 1 and n >= 1