2 ms·
No, it's the opposite. An O(n^2) algorithm sorts n items in n^2 time. So O(n^2) is worse than O(n). (should really be θ rather than O but you get my point)
by wavemode 1y ago
No, it's the opposite. An O(n^2) algorithm sorts n items in n^2 time. So O(n^2) is worse than O(n).
(should really be θ rather than O but you get my point)