Skip to content

Instantly share code, notes, and snippets.

@madelinecr
Created March 20, 2012 02:11
Show Gist options
  • Save madelinecr/2130124 to your computer and use it in GitHub Desktop.
Save madelinecr/2130124 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