Created
December 30, 2016 18:14
-
-
Save Juddling/035b7730e273fdc305ca1259a60e4e5e to your computer and use it in GitHub Desktop.
This file contains hidden or 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 [] = [] | |
| quicksort (pivot:tail) = sorted_less ++ [pivot] ++ sorted_greater | |
| where | |
| sorted_less = quicksort [x | x <- tail, x <= pivot] | |
| sorted_greater = quicksort [x | x <- tail, x > pivot] | |
| main = do | |
| putStrLn "quicksort:" | |
| print $ quicksort [10,9..0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment