Question: Write the PsuedoCode for the below public static int r(int x, int y){ if (x == 0) return 0; int i = r(x-1,y); if (i==y-1)

Write the PsuedoCode for the below

public static int r(int x, int y){

if (x == 0)

return 0;

int i = r(x-1,y);

if (i==y-1)

return 0;

return i+1;

}

public static int q(int x, int y){

if (x == 0){

return 0;

}

if (r(x,y) == 0) return q(x-1,y)+1;

return q(x-1,y);

}

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!