Hacker News new | ask | show | jobs
by cgoddard 5594 days ago
Actually for small values of n, an n^2 sort can be quicker than an nlogn sort, depending on how it is implemented.
1 comments

Yeah, hence insertion sort (the best n^2 sorter) is used to speed up quick-sort. It's insane to think of using bubble sort for the same task. (And for n=2, you don't need a sorting algorithm.)