Hacker News new | ask | show | jobs
by FabHK 2523 days 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.