Skip to content

Instantly share code, notes, and snippets.

@SunskyXH
Created December 17, 2017 05:23
Show Gist options
  • Select an option

  • Save SunskyXH/afb5e7b57529edb34c6b23752eef8b96 to your computer and use it in GitHub Desktop.

Select an option

Save SunskyXH/afb5e7b57529edb34c6b23752eef8b96 to your computer and use it in GitHub Desktop.
quick sort in reason
let rec quicksort = (gt) =>
fun
| [] => []
| [x, ...xs] => {
let (ys, zs) = List.partition(gt(x), xs);
quicksort(gt, ys) @ [x, ...quicksort(gt, zs)]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment