Question: Q - RECURSION - C ) Consider the following code fragment. 1 3 public static int example ( int x , int y ) 1

Q-RECURSION-C) Consider the following code fragment.
13 public static int example(int x, int y)
14{
15if(x <=1)
16{
17 return y;
18}
19else
20{
21 return example(x -1, y)* example(x -1, y);
22}
23}//end example method
What is the base case for the example method?
Question 11 options:
a)
return example(x -1, y)* example(x -1, y);
b)
if(x <=1) return y;
c)
public static int example(int x, int y)
d)
if(y <=1) return x;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!