Just to let you know, Simon Marlow put the mergesort implementation into
the CVS libraries a bit over a week ago:
http://cvs.haskell [..]
Does this mean that next GHC release implements standard List.sort
with the `merge' algorithm?
-
Serge Mechveliani
[EMAIL PROTECTED
On Sun, May 12, 2002 at 09:22:02PM +0100, Claus Reinke wrote:
randomise l = do
map snd $ sortBy compareIdx $ zip rs l
where
n = length l
rs = take n $ randomRs (1,n) $ mkStdGen 100
compareIdx (i,_) (j,_) = i `compare` j
rsort l = sort $ randomise l
This
Hi all
I am curious as to why the List.sort implementation in GHC is a
quicksort algorithm rather than an algorithm that guarantees n log n
time in the worst case? I have attached a mergesort implementation along
with a few scripts to time it's performance, the results of which are
shown below