(int x, int n)
| 82 | } |
| 83 | |
| 84 | public static int power(int x, int n) { |
| 85 | if(n == 0) { |
| 86 | return 1; |
| 87 | } |
| 88 | // int xnm1 = power(x, n-1); |
| 89 | // int xn = x * xnm1; |
| 90 | // return xn; |
| 91 | |
| 92 | return x * power(x, n-1); |
| 93 | } |
| 94 | |
| 95 | public static int optimizedPower(int x, int n) { |
| 96 | if(n == 0) { |
nothing calls this directly
no outgoing calls
no test coverage detected