Question: Questions 6: a&b 7: only 9: c&d mg method: int puzzle(int base, int limit) { if (base > limit) return -1; else if (base -


Questions 6: a&b 7: only 9: c&d mg method: int puzzle(int base, int limit) { if (base > limit) return -1; else if (base - limit) return 1; else return base puzzle(base + 1, limit); 3 6. Identify 1. The base case(s) of the puzzle method b. The general case(s) of the puzzle method e Constraints on the arguments passed to the puzzle method 7. Show what would be written by the following calls to the recursive method puzzle. 1. System out.println(puzzle (14, 10)): b System out.println(puzzle (4. 7)): e. System out.println(puzzle (0, 0)) 9. For each of the following recursive methods, identify the base case, the general case, and the constraints on the argument values, and explain what the method does. a. i nt power (int base, int exponent) 0) if (exponent return 1: else return (base power (base, exponent - 1)); b. int factorial (int n) 1)): if (n > 0) return (n. factorial (n. else if (n- 0) return 1; c. int recur(int n) if (
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
