Q43. private int func2(int m, int n) { if (n == 0) return 0; else return m + func2(m, n-1); } Which of the following statements about the code above is always true? Q44. A method is called directly recursive if it calls another recursive method. Q45. Recursion starts with the base case. Q46. public static int exampleRecursion (int n) Refer to the code above. What is the output of exampleRecursion(0)? Q47. In the base case, the solution is obtained through a call to a smaller version of the original method. Q48. In reality, if you execute an infinite recursive method on a computer it will execute forever. Q49. Every recursion definition must have zero or more base cases. Q50. private int func1(int m, int n) { What precondition must exist in order to prevent the code above from infinite recursion? |
Expert Answer