//  File: t-quick.C
//  Test the Quicksort routines

#include <iostream.h>
#include <stdlib.h>
#include "array.h"
#include "sorts.h"

main(int argc, char *argv[]) {
   int size=0, seed=0 ;

   if (argc != 3) {
      cerr << "Usage: t-quick 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) ;

   QuickSort(A) ;

#ifndef NDEBUG
   if (!A.check()) {
      cout << "Sorting routine INCORRECT!" << endl ;
   }
   A.print() ;
#endif 

}
