1 void 2 InsertionSort(ElementType A[], int N) 3 { 4 int j, P; 5 ElementType Tmp; 6 for (P = 1; P < N; P++) 7 { 8 Tmp = A[P]; 9 for (j = P; j > 0 && A[j - 1] > Tmp; j--) 10 A[j] = A[j - 1]; 11 A[j] = Tmp; 12 } 13 }