Created
April 18, 2011 10:06
-
-
Save tautologico/925104 to your computer and use it in GitHub Desktop.
QuickSort in OCaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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