Created
August 3, 2020 09:24
-
-
Save BMU-Verlag/9c1f64d8cb3a80354f61aa3506636173 to your computer and use it in GitHub Desktop.
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 (x:xs) = quicksort teil1 ++ [x] ++ quicksort teil2 | |
where | |
teil1 = [y | y <- xs, y <= x] | |
teil2 = [y | y <- xs, y > x] | |
main = print (quicksort [9, 7, 4, 11, 13, 15, 2, 8]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment