Skip to content

Instantly share code, notes, and snippets.

@5outh
Created April 3, 2012 06:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 5outh/2289792 to your computer and use it in GitHub Desktop.
Save 5outh/2289792 to your computer and use it in GitHub Desktop.
Quick Sort
quickSort :: (Ord a) => [a] -> [a]
quickSort [] = []
quickSort (x:xs) = quickSort smaller ++ [x] ++ quickSort larger
where smaller = filter (<=x) xs
larger = filter (>x) xs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment