To my suggestion of the  merge sort  for the  sort  implementation

Simon Marlow <[EMAIL PROTECTED]>  writes


> GHC's sort implementation is a well-optimised quicksort plundered originally
> from the hbc library I believe.  In your example above you mention testing
> it on an already sorted list, which is the worst case example for this
> sorting algorithm, since it picks the first element of the list as the
> paritition.  Try some tests on random lists, I think you'll find GHC's sort
> does rather better.
>
> However, we're open to suggestions (backed up by numbers, of course) for a
> better algorithm.


I really think merge sort is "better".
Because in practice, the worst case weights more, it is more than mere 
one of the random cases. 
But i admit, the thing is arguable and somewhat, depends on the taste. 
What i wanted to say now, it surprises me that most people think of the 
algorithm cost preferably as of the average one, not the worst-case.


------------------
Sergey Mechveliani
[EMAIL PROTECTED]

Reply via email to