I tried \"x = y ** e\", but that didn\'t work.
int power(int x,int y){ int r=1; do{ r*=r; if(y%2) r*=x; }while(y>>=1); return r; };
(iterative)
int power(int x,int y){ return y?(y%2?x:1)*power(x*x,y>>1):1; };
(if it has to be recursive)
imo, the algorithm should definitely be O(logn)