Solved

Rewrite the Following Iterative Method as a Recursive Method That

Question 38

Essay

Rewrite the following iterative method as a recursive method that computes the same thing. NOTE: your recursive method will require an extra parameter.
public String reversal(String x)
{
int y = x.length( );
String s = "";
for (int j = y-1; j >=0; j--)
s += x.charAt(j);
return s;
}

Correct Answer:

verifed

Verified

public String reversal(String ...

View Answer

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions