Created
August 12, 2019 14:56
-
-
Save plavjanik/425e64e2a9077d896af332788a29b171 to your computer and use it in GitHub Desktop.
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
quicksort :: Ord a => [a] -> [a] | |
quicksort [] = [] | |
quicksort (p:xs) = (quicksort lesser) ++ [p] ++ (quicksort greater) | |
where | |
lesser = filter (< p) xs | |
greater = filter (>= p) xs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment