早教吧 育儿知识 作业答案 考试题库 百科 知识分享
创建时间 资源类别 相关度排序
共找到 610 与1;if 相关的结果,耗时89 ms rss sitemap
下面算法的时间复杂度为(34)。 int f(unsigned int n){ if(n=0||n==1)return 1; else return n*f(n-1); }A.O(1)B.O(n)C.O(n2)D.O(n!)
设有一个递归算法如下: int fact(int n){ if(n<=0)return 1; else return n*fact(n-1); } 下面正确的叙述是(35)。A.计算fact(n)需要执行n次函数调用B.计算fact(n)需要执行n+1次函数调用C.计算fact(n)需要执行n+2