#GESP3041. [GESP]L5-202503-Q3041-S
[GESP]L5-202503-Q3041-S
对下面两个函数,说法错误的是( )。
int factorialA(int n) {
if (n <= 1) return 1;
return n * factorialA(n-1);
}
int factorialB(int n) {
if (n <= 1) return 1;
int res = 1;
for(int i=2; i<=n; i++)
res *= i;
}
{{ select(1) }}
- 两个函数的实现的功能相同。
- 两个函数的时间复杂度均为 。
- factorialA 采用递归方式。
- factorialB 采用递归方式。
相关
在下列比赛中: