判断题:Let n be a non-negative integer representing the size of input.
Let $$n$$ be a non-negative integer representing the size of input. The time complexity of the following piece of code is $$\Theta (n^2)$$.
int func(int n){
int sum = 0;
for(int i = 1; i < n; i *= 2)
for(int j = 0; j < i; j++)
sum++;
return sum;
}
答案:FALSE
int func(int n){
int sum = 0;
for(int i = 1; i < n; i *= 2)
for(int j = 0; j < i; j++)
sum++;
return sum;
}
答案:FALSE