Re: Fastest Sort for text and numbers
Re: Fastest Sort for text and numbers
- Subject: Re: Fastest Sort for text and numbers
- From: Emmanuel <email@hidden>
- Date: Mon, 30 Apr 2001 18:50:05 +0200
At 16:58 +0200 30/04/01, Bourque, Jason wrote:
>
>
Hello,
>
>
I know this has come up before but I can't find the thread for it.
>
>
Does anyone have the sorting routine that was deemed the fastest?
There is no such thing as a fastest sorting routine. This can only make
sense for one given "disorder", or if one specifies a probability law on
the configurations which will have to be sorted.
In other words, one algorithm could be the fastest on totally random lists,
and be one of the worst when it comes to a list almost ordered (say, first
item last).
Smile's 'sort' routine can be the fastest in some cases. It is certainly
one of the shortest (15 short lines). You'll find it in the "Application"
class script. Some minor editing can be required for special sorts.
The only issue with Smile's 'sort' routine is that it is recurrent (it
calls itself), so stack overflows may always occur with large lists.
HTH
Emmanuel