// From the software distribution accompanying the textbook // "A Practical Introduction to Data Structures and Algorithm Analysis, // Third Edition (C++)" by Clifford A. Shaffer. // Source code Copyright (C) 2007-2011 by Clifford A. Shaffer. // Insertion Sort implementation and timing test driver #include "book.h" // Include comparator functions #include "compare.h" // Insertion sort implementation template void inssort(E A[], int n) { // Insertion Sort for (int i=1; i0) && (Comp::prior(A[j], A[j-1])); j--) swap(A, j, j-1); } template void sort(E* array, int n) { inssort(array, n); } #include "sortmain.cpp" int main(int argc, char** argv) { return sortmain(argc, argv); }