News for hackers. Stuff that matters.
Re:I'm a cargo cult programmer, help me by cgoddard on Friday February 25, 2011 @07:56PM (#2264459)
Actually for small values of n, an n^2 sort can be quicker than an nlogn sort, depending on how it is implemented.
Re:I'm a cargo cult programmer, help me by Jach on Friday February 25, 2011 @09:07PM (#2264602)
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.)