here can we solve it like this f=n/4 and then calculation power (2,f) using recursion
CPP - Recursion - Tiling Problem. Search Contents.. search < Dashboard
int powr(int a, int b){
int x = 1;
while(b){
if(b & 1) x = x * a;
a = a * a ;
b >>= 1;
}
return x;
}
this funtion gives pow(a,b) in log b time.
use this to calculate pow(2,n);