Skip to content

Instantly share code, notes, and snippets.

@missett
Created December 21, 2013 13:34
Show Gist options
  • Save missett/8069375 to your computer and use it in GitHub Desktop.
Save missett/8069375 to your computer and use it in GitHub Desktop.
Haskell implementation of the quicksort algorithm
quicksort :: (Ord a) => [a] -> [a]
quicksort [] = []
quicksort (x:xs) = let lesser = filter (< x) xs
greaterThanOrEqual = filter (>= x) xs
in quicksort lesser ++ [x] ++ quicksort greaterThanOrEqual
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment