// File: t-merge.C // Test the Merge Sort routines #include #include #include "array.h" #include "sorts.h" main(int argc, char *argv[]) { int size=0, seed=0 ; if (argc != 3) { cerr << "Usage: t-merge size seed" << endl ; exit(1) ; } size = atoi(argv[1]) ; seed = atoi(argv[2]) ; if (size <= 0 || seed <= 0) { cerr << "Bad size or seed" << endl ; exit(1) ; } Array A(size, seed) ; MergeSort(A) ; #ifndef NDEBUG if (!A.check()) { cout << "Sorting routine INCORRECT!" << endl ; } A.print() ; #endif }