Void cinsertionsort: path2insertion (void) {// element 0 is a sentinel. Const int COUNT = 9, length = count-1; int L [count] = {0, 49, 38, 65, 97, 76, 13, 27, 49 }; // sort the sequence table L by 2-path insertion. Int d [length] = {0}; d [0] = L [1]; // The first record of D in L is the record with the sorting order in D. Int first = 0, final = 0; // first and final indicate the positions of the first and last records in the order of the records in D. For (INT I = 2; I <= length; ++ I) // sort the 2nd ~ Insert the last record to D. {If (L [I] <D [first]) // The value of the record to be inserted is smaller than the minimum value in D and before d [first] (the element of D array does not need to be moved ). {First = (first-1 + length) % length; d [first] = L [I];} else if (L [I]> d [Final]) // if the value of the record to be inserted is greater than the minimum value in D, insert the record to d [Final] (the element of D array does not need to be moved ). {Final = final + 1; d [Final] = L [I];} else // The number of records to be inserted must be greater than the minimum value in D and less than the maximum value in D, insert it to the center of D (Elements of D array need to be moved ). {Int J = final ++; // move the end element of D to insert records in sequence. While (L [I] <D [J]) {d [(j + 1) % length] = d [J]; j = (J-1 + length) % length;} d [J + 1] = L [I] ;}} for (INT I = 1; I <= length; I ++) // cyclically assigns d to L. {L [I] = d [(I + first-1) % length]; // linear relationship.} // Print the sorting result. For (INT I = 0; I <= length; ++ I) {cout <L [I] <"\ t" ;}cout <Endl ;}