有一个递归算法如下:
int fact(int n){ if(n <= 0) return 1; else return n * fact(n - 1); }
则计算fact(n)需要调用该函数的次数为( )。
(A)n + 1
(B)n - 1
(C)n
(D)n + 2
Copyright ©