x=n //n>1y=0while(x>=(y+1)*(y+1))y++
这的时间复杂度是多少啊 求解
当y=sqrt(n)时,循环结束,y从0到sqrt(n)-1一共循环了sqrt(n)次,因此时间复杂度为sqrt(n)
y=sqrt(n)
y
0
sqrt(n)-1
sqrt(n)