Another algo for faster sorting

tsbockman via Digitalmars-d digitalmars-d at puremagic.com
Thu Apr 7 10:54:06 PDT 2016


On Thursday, 7 April 2016 at 16:23:31 UTC, Jonathan Villa wrote:
> ...then searching for other sorting algorithms I found 
> SHELL-SORT, it's not recursive and it ended being even faster 
> than Quicksort (what the heck? xd, well probably the JIT 
> compiler).

It would be cool to have a shell sort implementation available 
for small data sets. It's a bad choice in the general case 
though, because its asymptotic scaling is worse than the standard 
O(N log(N)) achieved by stuff like Timsort.

Quicksort is actually bad too, because its worst case asymptotic 
complexity is an embarrassing O(N^2), which makes it highly 
vulnerable to denial-of-service attacks.


More information about the Digitalmars-d mailing list