Burstsort: Fastest known algorithm to sort large set of strings
goanna.cs.rmit.edu.au
goanna.cs.rmit.edu.au
http://perspectives.mvdirona.com/2008/07/08/HadoopWinsTeraSo...
http://svn.apache.org/viewvc/hadoop/core/trunk/src/examples/...
Judging from their graphs, Burstsort is fastest by a wide margin for sufficiently large datasets.
Also oddly interesting, according to some page I was reading on Quicksort before this, there exist adaptive algorithms that generate worst case data sets for Quicksort no matter what the partitioning scheme is.
Also one can always select the median in (deterministic) linear time. This way quicksort won't degenerate to O(n^2) ever.
Still, a cool progam.
PS: It still doubles the time but that's not important in O notation.
If you are interested in general sorting algorithm with good worst case performance, try merge sort. Merge sort is O(Nlog(N)) independent of input data, but with significantly larger constants than quick sort, also in theory it requires O(N) auxiliary space, but that is only case for arrays, linked-lists can be sorted in place.
This is basically Radix sort (radix sort : tries :: heap sort : heaps) with a cache optimization, which is neat.
I wonder if you could crudely determine a number based on inspecting the size of the cache of the machine at runtime.
I think the most impressive part about the whole thing is that the cache optimization flows naturally out of how the Trie is constructed rather than any voodoo on their part. (Since each string is handled once, rather than m times, where m is the string length, as in a pure radix sort.)
It makes me wonder if the cache optimization aspect was foreseen or accidental.
http://blogs.msdn.com/devdev/archive/2007/06/12/cache-oblivi...
"This is a particularly fun area, one dear to my heart because I've done a lot of research in this area. This is an area co-founded by Professor Leiserson. So, in fact, the first context in which I met Professor Leiserson was him giving a talk about cache oblivious algorithms at WADS '99 in Vancouver I think. Yeah, that has to be an odd year. So, I learned about cache oblivious algorithms then, started working in the area, and it's been a fun place to play. But this topic in some sense was also developed in the context of this class. I think there was one semester, probably also '98-'99 where all of the problem sets were about cache oblivious algorithms."
http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Compute...