Skip to content

Instantly share code, notes, and snippets.

@kunishi
Created January 29, 2014 10:18
Show Gist options
  • Save kunishi/8685133 to your computer and use it in GitHub Desktop.
Save kunishi/8685133 to your computer and use it in GitHub Desktop.
fun mergeSort(nil) = nil
| mergeSort([a]) = [a]
| mergeSort(L) =
let
val (M, N) = split(L);
val M = mergeSort(M);
val N = mergeSort(N);
in
merge(M, N)
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment