Skip to content

Instantly share code, notes, and snippets.

@BinRoot
Created December 15, 2012 23:40
Show Gist options
  • Select an option

  • Save BinRoot/4300956 to your computer and use it in GitHub Desktop.

Select an option

Save BinRoot/4300956 to your computer and use it in GitHub Desktop.
quicksort :: Ord a => [a] -> [a]
quicksort [] = []
quicksort (p:xs) = (quicksort lesser) ++ [p] ++ (quicksort greater)
where
lesser = filter (< p) xs
greater = filter (>= p) xs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment