Last active
October 19, 2019 14:49
-
-
Save pedrominicz/e277d60eb59f0c11b5b3a549d066730f to your computer and use it in GitHub Desktop.
Quick! Quicksort in Haskell!
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
module Quick where | |
qsort :: Ord a => [a] -> [a] | |
qsort [] = [] | |
qsort (x:xs) = less ++ x:more | |
where less = qsort $ filter (< x) xs | |
more = qsort $ filter (>= x) xs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment