指出下列程序段的时间复杂度()


指出下列程序段的时间复杂度()

sum=1;for(i=0;sum sum+=1。

A.O(n)

B.O(n*n)

C.O(1)

D.O(0)

正确答案:O(n)


Tag:复杂度 时间 程序 时间:2024-01-15 15:58:09