// 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. // Bubble Sort implementation and timing test driver #include "book.h" // Include comparator functions #include "compare.h" // Bubble sort implementation template void bubsort(E A[], int n) { // Bubble Sort for (int i=0; ii; j--) if (Comp::prior(A[j], A[j-1])) swap(A, j, j-1); } template void sort(E* array, int n) { bubsort(array, n); } #include "sortmain.cpp" int main(int argc, char** argv) { return sortmain(argc, argv); }