Last active
August 29, 2015 14:03
-
-
Save metallurgix/3fc0472bba340c450f01 to your computer and use it in GitHub Desktop.
Insertion Sort
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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