7 lines
202 B
Plaintext
7 lines
202 B
Plaintext
|
quicksort :: Ord a => [a] -> [a]
|
||
|
quicksort [] = []
|
||
|
quicksort (p:xs) = (quicksort lesser) ++ [p] ++ (quicksort greater)
|
||
|
where
|
||
|
lesser = filter (< p) xs
|
||
|
greater = filter (>= p) xs
|