Created
May 15, 2012 09:36
-
-
Save mmagm/2700398 to your computer and use it in GitHub Desktop.
haskell quick sort
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
qsort :: Ord a => [a] -> [a] | |
qsort [] = [] | |
qsort (x:xs) = qsort lesser ++ [x] ++ qsort greater | |
where | |
lesser = filter (< x) xs | |
greater = filter (>= x) xs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment