Can somebody help me with these four questions. Please. i am learning recursions in Java.
Question1. Trying to find the value of result when its (5) from this code.
public int result(int n)
return 2 * result(n-1)
public int f (int k, int n)
if (n > k)
return f(k, n-k);
return f(k-n, n)
I need the value returned by the call f(6,8)? and little bit of working for me to understand
i need to know what the method recur does in this code
public int recur(intx, int n)
from the code below what will the value of z be when z = kwame( kwame (3) + kwame (4));
public int kwame(int x)
if (x==1 || x==3)
return x * kwame(x-1);