单选题:设 $$n$$ 是描述问题规模的非负整数,下列程序段的时间复杂度是:
设 $$n$$ 是描述问题规模的非负整数,下列程序段的时间复杂度是:@[B](2)
```
x = 0;
while ( n >= (x+1)*(x+1) )
x = x+1;
```
A. $$O(log n)$$
B. $$O(n^{1/2})$$
C. $$O(n)$$
D. $$O(n^2)$$
A.$$O(log n)$$
B.$$O(n^{1/2})$$
C.$$O(n)$$
D.$$O(n^2)$$
答案:B
```
x = 0;
while ( n >= (x+1)*(x+1) )
x = x+1;
```
A. $$O(log n)$$
B. $$O(n^{1/2})$$
C. $$O(n)$$
D. $$O(n^2)$$
A.$$O(log n)$$
B.$$O(n^{1/2})$$
C.$$O(n)$$
D.$$O(n^2)$$
答案:B