-->
当前位置:首页 > 题库 > 正文内容

判断题:Let n be a non-negative integer representing the size of input.

Luz4年前 (2022-01-18)题库1271
Let $$n$$ be a non-negative integer representing the size of input. The time complexity of the following piece of code is $$O(n)$$.

int func(int n){
int sum = 0;
for(int i = n; i > 0; i /= 2)
for(int j = 0; j < i; j++)
sum++;
return sum;
}


答案:TRUE

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。