高普考題庫
103 年 103年公務人員高等考試三級考試暨普通考試・計算機概論
申論 2執行下列遞迴(Recursion)程式,並回答下列各題:public class CrazyR{public static void R(int n, int t){if (n == 0){StdOut.print(t + " ");return;}R(n-1, 3*t);R(n-1, 3*t+2);R(n-1, 3*t+1);}public static void main(String[] args){R(2, 0);StdOut.println();}}程式執行時會產生那些遞迴呼叫(Recursive call),依執行順序畫出其樹狀結構。(8 分)程式在執行後依序列出輸出的數字。(4 分)103年公務人員高等考試三級考試試題 代號:26650、26750 (背面)類 科: 工業行政、電力工程、電子工程、電信工程科 目: 計算機概論