[单选题]下面程序段的时间复杂度为( )。
for(i=1,s=0;i<=n;i++)
for(j=2*i;j<=n;j++) s++;

A
O(1)
B
O(n)
C
O(n2)
D
O(nlog2n)
正确答案:C
扫描二维码
免费搜题、免费刷题、免费查看解析