Recursion worksheet
Recursion worksheet
For each problem, trace the code segment and identify the output of the code.
Problem 1
When x == 2
Trace the code segment in the space below to determine the output of the call mystery(10).
Retun y/division(y-3)
Trace the code segment in the space below to determine the output of the call division(14).
Problem 3
int[] numbers = {21, 2, 4, 82, 81, 33, 67, 52, 22, 23};
int sum = sumNumbers(numbers, numbers.length);
System.out.println("Sum: " + sum);
Problem 4
Trace the code segment in the space below to determine the output of RecursionRunner.