• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Sooo.. whats the fastest sort algorithm nowadays?

blahblah99

Platinum Member
I'm familiar with shell sort, quick sort, heap sort, etc. Has there been any evolution in sort algorithms over the last 10 years or have sort algorithms reached its speed peak, assuming a random array of N elements have to be sorted and that the elements can be all strings or all numeric.

To me it seems like any of the O(n log n) are commonly used. Is there anything better or is O(n log n) the fastest it'll ever get?
 
It depends on what you are sorting. If it is a list of Ints and possibly even floats, then a radix sort is still the fastest.

After that, it depends on application. For example. If you are working with slow media, then a merge sort would be the best bet. Quick sort generally works really good, but there are some cases where a heap sort will be faster.

For comparison sorts, nothing is faster then a O(n log n). However, since a radix sort isn't a comparison sort it comes to a O(k*n), where k the number of digits being processed.

merge sort is the easiest to multi-thread (though quick sort isn't too bad). Radix sorting can be multi threaded, but its a pain. You have to use MSD radix sort as opposed to the easer to write LSD radix sort.
 
There is a provable worst-case lower bound on sorting in the comparison model, that is Omega(n*floor(log(n))). So if you were expecting to check back every 5 years for a better algorithm, I think you'll be disappointed.
 
you need more chinese people and monkeys in your box...that might help things out a bit 😀

anyways, wouldnt the 'fastest' algorithm be totally dependent on hardware and what you are sorting?
 
Back
Top