<awangdev>Pow(x, n)_1.java
public double helper(double x, int n) {
        if (n == 0) {
            return 1;
        }
        if (n == 1) {
            return x;
        }
        double val = helper(x, n / 2);
        if (n % 2 == 0) {
            return val * val;
        } else {
            return val * val * x;
        }
    }
public double sample_funcname ( double x , int n ) {
  if ( n == 0 ) {
    return 1 ;
  }
  if ( n == 1 ) {
    return x ;
  }
  double val = helper ( x , n / 2 ) ;
  if ( n % 2 == 0 ) {
    return val * val ;
  }
  else {
    return val * val * x ;
  }
}
