for (int i = 1; i <= MAXN; i++)
for (int j = i; j <= MAXN; j += i);
Can anybody explain to me why the time complexity for this code is O(N log N)?
Dumb question on time complexity
for (int i = 1; i <= MAXN; i++)
for (int j = i; j <= MAXN; j += i);
Can anybody explain to me why the time complexity for this code is O(N log N)?
| Rev. | Язык | Кто | Когда | Δ | Комментарий | |
|---|---|---|---|---|---|---|
| en1 |
|
Dumbledore | 2016-01-05 23:07:20 | 214 | Initial revision (published) |