123456789101112131415161718
void insert_sort(int a[], int size) { int index, position; for(index = 1; size - 1; index++) { position = index; int key = a[index]; while(position > 0 && key < a[position-1]) { a[position] = a[position-1]; position = position - 1; } a[position] = key; } }
size - 1