Skip to content

Instantly share code, notes, and snippets.

@o-sam-o
Created July 17, 2011 02:18
Show Gist options
  • Save o-sam-o/1087034 to your computer and use it in GitHub Desktop.
Save o-sam-o/1087034 to your computer and use it in GitHub Desktop.
Haskell QuickSort
myQS :: (Ord a) => [a] -> [a]
myQS [] = []
myQS (x:xs) = myQS lessThanPivot ++ [x] ++ myQS greaterThanEqualToPivot
where lessThanPivot = [l | l <- xs, l < x]
greaterThanEqualToPivot = [l | l <- xs, l >= x]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment