Skip to content

Instantly share code, notes, and snippets.

@tautologico
Created April 18, 2011 10:06
Show Gist options
  • Save tautologico/925104 to your computer and use it in GitHub Desktop.
Save tautologico/925104 to your computer and use it in GitHub Desktop.
QuickSort in OCaml
let rec quick l =
match l with
[] -> []
| [x] -> l
| p :: rl -> (match List.partition (fun x -> x < p) rl with
(l1, l2) -> (quick l1) @ [p] @ (quick l2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment