15. 與迴圈(Loop)相比,下列哪一個不是使用遞迴(Recursive)的優點?
(A)程式可讀性高
(B)程式執行效率較高
(C)區域變數與暫存變數較少
(D)程式碼較短
答案:登入後查看
統計: A(132), B(916), C(171), D(97), E(0) #1914577
統計: A(132), B(916), C(171), D(97), E(0) #1914577
詳解 (共 5 筆)
#5912016
遞迴方式設計程式較簡易且容易了解。 但遞迴方式也是有它的缺 點,最大的缺點就在於,以遞迴方式執行時,會占用較多記憶體空間和 花費較多的CPU時間
7
0
#4596605
PROS:
Recursion can reduce time complexity.
Recursion adds clarity and reduces the time needed to write and debug code.
Recursion is better at tree traversal.
CONS:
Recursion uses more memory.
Recursion can be slow.
0
2