Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- quicksort :: (Ord a) => [a] -> [a]
- quicksort [] = []
- quicksort (x:xs) =
- let smallerSorted = quicksort [a | a <- xs, a <= x]
- biggerSorted = quicksort [a | a <- xs, a > x]
- in smallerSorted ++ [x] ++ biggerSorted
- quicksort :: (Ord a) => [a] -> [a]
- quicksort [] = []
- quicksort (x:xs) = smallerSorted ++ [x] ++ biggerSorted
- where smallerSorted = quicksort [a | a <- xs, a <= x]
- biggerSorted = quicksort [a | a <- xs, a > x]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement