// ***************************************************************** // Author: Zhixiang Chen // Class: CSCI/CMPE 3333, Fall 2014 // Lab 1: Binary search tree // Date: August 2014 // Comment: The code here is meant to be revised. //----------------------------------------------------------------- // Description: This program is to implement the binary search tree // class template // ***************************************************************** #include #include #include #include #include "lab3333_1_head.h" using namespace std; int main() { /********************************************************** Part A: Some practice **********************************************************/ //var decarations unsigned int seed; //a random seed int num; //to hold an int value binarySearchTree tree; //create a list of int type char tag; cout<<"loading the list with random numbers between 0 and 666 ... "< "; //get the random seed cin >> seed; srand(seed); //set the randon seed for (int i=0; i <10 ; i++) //insert 50 random numbers into the list { num = rand()%31; cout<>tag; switch (tag) { case 'd': case 'D': cout<<"What to be deleted? "; cin>> num; tree.remove(num); tree.inOrderTraversal(); cout<>num; if(tree.find(num)) cout<<"found "<< num <<" in the tree "<