62. 반씩 줄이는 거듭제곱 재귀
다음 Java 프로그램의 실행 결과를 쓰시오.
1public class Main {2static int calls = 0;34static int power(int b, int e) {5calls++;6if (e == 0) {7return 1;8}9int half = power(b, e / 2);10int r = (e % 2 == 0) ? half * half : half * half * b;11System.out.println("e=" + e + " r=" + r);12return r;13}1415public static void main(String[] args) {16System.out.println(power(3, 5) + " " + calls);17System.out.println(power(2, 6) + " " + calls);18}19}