It might just be faster because the author is comparing their hybrid radix sort implementation to std::sort (which is comparison-based). Would be more valid to compare to Boost's "spreadsort" which is similarly a hybrid radix sort algorithm (and also outperforms std::sort).
Why doesn't the STL switch to the hybrid sorting approach?
Writing a Faster Sorting Algorithm
11–20 of 35 posts
Re: Writing a Faster Sorting Algorithm
#12Re: Writing a Faster Sorting Algorithm
#13Earlier quoted context omitted.
Why doesn't the STL switch to the hybrid sorting approach?
AFAIK the STL is free to use any algorithm they want as long as it's O(n log n).
[1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n429...
Re: Writing a Faster Sorting Algorithm
#14Re: Writing a Faster Sorting Algorithm
#15Earlier quoted context omitted.
"the" STL?
STL means "standard template library." It's perfectly reasonable to say "the standard template library."
Re: Writing a Faster Sorting Algorithm
#16It might just be faster because the author is comparing their hybrid radix sort implementation to std::sort (which is comparison-based). Would be more valid to compare to Boost's "spreadsort" which is similarly a hybrid radix sort algorithm (and also outperforms std::sort).
I had a feeling that O(N) is pretty impossible for the general use case.
Basically, how many elements do you have to move in a list of N elements to end up with one of the possible orderings
Re: Writing a Faster Sorting Algorithm
#17Re: Writing a Faster Sorting Algorithm
#18It might just be faster because the author is comparing their hybrid radix sort implementation to std::sort (which is comparison-based). Would be more valid to compare to Boost's "spreadsort" which is similarly a hybrid radix sort algorithm (and also outperforms std::sort).
I had a feeling that O(N) is pretty impossible for the general use case.
However, it might be possible if comparisons are not essential - e.g. radix sort is (with some assumptions) O(N)
Re: Writing a Faster Sorting Algorithm
#19Earlier quoted context omitted.
I had a feeling that O(N) is pretty impossible for the general use case.
I think there's a (provable) mathematical impossibility to have a general O(N) sorting algorithm Basically, how many elements do you have to move in a list of N elements to end up with one of the possible orderings
The problem is the information in a permutation (n! possible orderings) and one can only ever "throw away" half of them on every comparison, leading to log_2(n!) or nlog(n).
Re: Writing a Faster Sorting Algorithm
#20Earlier quoted context omitted.
I had a feeling that O(N) is pretty impossible for the general use case.
I think there's a (provable) mathematical impossibility to have a general O(N) sorting algorithm Basically, how many elements do you have to move in a list of N elements to end up with one of the possible orderings
Most people would be fine with a hybrid radix sort for day to day use.