判断下列代码段的大O级别:def b1(n): k = 0 for i in range(0, n): j = 1 while j < n: k += 1 j = j << 1 print(k)
A、O(nlogn);
B、O(n^2);
C、O(n^3);
D、O(1)
发布时间:2024-08-24 17:28:55
A、O(nlogn);
B、O(n^2);
C、O(n^3);
D、O(1)
for j in range(n):
for k in range(n):
c[i][j] += a[i][k] * b[k][j]