[Haskell-cafe] Quick Sort Algorithm

PR Stanley prstanley at ntlworld.com
Thu May 17 15:39:11 EDT 2007


Yes, sorry, I missed the firt line of the algorithm when I was 
pasting it into the email. Okay
qSort [] = [x]
-- and even
qSort [x] = x
The code fragment below still doesn't work.

>>qSort (x:xs) =
>>     qSort smaller ++ [x] ++ qSort larger
>>     where
>>     smaller = [a | a . xs, a x ]
>>     larger = [b | b . xs, b > x ]

Cheers
Paul



More information about the Haskell-Cafe mailing list