2 ms·
Yes. What sort of reasoning is that? I can present the result in a square picture, thus it's O(n)... The point is that creating each row of the picture does not
by FabHK 7y ago
Yes. What sort of reasoning is that? I can present the result in a square picture, thus it's O(n)... The point is that creating each row of the picture does not take constant time; a longer row will take more time to create.
Both selection sort and insertion sort are O(n^2).
Sorting by pairwise comparison is O(n log n) at best.