Skip to content

Instantly share code, notes, and snippets.

@gnarayan81
Last active September 30, 2015 23:13
Show Gist options
  • Save gnarayan81/5efd4d4cce68922b9d46 to your computer and use it in GitHub Desktop.
Save gnarayan81/5efd4d4cce68922b9d46 to your computer and use it in GitHub Desktop.
#include <thing>
void swap(Type<> i, Type<> j) {
t = i;
i = j;
j = t;
}
RetType<> merge_sort(Array_of_Type<> a, size_of_a) {
if (size_of_a > 1) {
merge_sort(a/2, size/2);
merge_sort(a+size/2, size/2);
merge_now();
} else {
swap(a, a/2);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment