Skip to content

Instantly share code, notes, and snippets.

@5outh
Created Apr 3, 2012
Embed
What would you like to do?
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