i am writing a recursive algorithm for the function 2^n, and the formula that must be used is: 2^(n-1) + 2^(n-1) = 2^n
heres what i have so far:
i am not sure how to do the recursion to get that formula, can someone point me in the right direction? thanksCode://computes 2^n recursively using the formula 2^n=2^n-1 + 2^n-1 x(int n) { if(n=0) return 1; else }




Reply With Quote