Skip to content

Instantly share code, notes, and snippets.

@metallurgix
Last active August 29, 2015 14:03
Show Gist options
  • Save metallurgix/3fc0472bba340c450f01 to your computer and use it in GitHub Desktop.
Save metallurgix/3fc0472bba340c450f01 to your computer and use it in GitHub Desktop.
Insertion Sort
void isort (int array[], int len)
{
register int i, j, t;
for (i = 1; i < len; i++)
{
j = i;
t = array[j];
while (j > 0 && array[j-1] > temp)
{
array[j] = array[j-1];
j--;
}
array[j] = t;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment