/******************************************************* Proj4.C CMSC-341 Spring 2004 Project4 Spencer Shimko, Section 001, sshimko1 Created: 07 April 2004 Current: 07 April 2004 Compare various actions on BSTs and HTs I have read and I understand the course policy on cheating. By submitting the following program, I am stating that the program was produced by my individual effort. *********************************************************/ #include #include using namespace std; #include "Proj4Aux.H" // Begin main int main( int argc, const char* argv[] ){ // usage for command const char* USAGE = "Usage: ./Proj4 "; if ( argc != 3 ){ cout << USAGE << endl; return 1; } // convert command line to integer equivalents int seed = atoi(argv[1]); int cnt = atoi(argv[2]); if ( ( seed < 1 ) || ( cnt < 1 ) ){ cout << USAGE << endl; return 1; } // display output header cout << argv[0] << " " << argv[1] << " " << argv[2] << endl; // 2 parallel vectors for statistical purposes vector v1; vector v2; // setup output header cout << "==================================================" << endl; cout << " Starting simulation..." << endl; cout << "--------------------------------------------------" << endl; cout << "Seed : " << seed << endl; cout << "N : " << cnt << "\n" << endl; // setup vectors based on cmd line args setupVectors( v1, v2, seed, cnt ); // create bst using vector v1 and // perform ops on binary search tree testBST ( v1, v2 ); // create ht using vector v1 and // perform same ops on ht; testHT ( v1, v2 ); }