Skip to content

Instantly share code, notes, and snippets.

@crimx
Created April 12, 2014 04:52
Show Gist options
  • Save crimx/10519337 to your computer and use it in GitHub Desktop.
Save crimx/10519337 to your computer and use it in GitHub Desktop.
Insertion sort template
int Isort(int a[], int s, int e) {
int i, j, t;
for(i=s+1; i <= e; i++) {
t = a[i];
for(j = i-1; j>=s && a[j]>t; j--)
a[j+1] = a[j];
a[j+1] = t;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment