public static int exponent(int n){ int ans; if(n == 0) return 1; else if(n%2 == 0){ int k = exponent(n/2); ans = k*k; } ans= 2 * exponent(n-1); return ans ; }