// File: main1.C // // Testing the BSTree class. #include #include #include #include "bstree.h" main() { try { BSTree *Tptr, *temp ; Tptr = new BSTree ; Tptr->insert(5) ; Tptr->insert(2) ; Tptr->insert(3) ; Tptr->insert(8) ; Tptr->insert(6) ; Tptr->insert(9) ; cout << "\nInorder Traversal:\n" ; Tptr->inorder() ; cout << endl ; cout << "\nMin Item:\n" ; temp = Tptr->min() ; cout << temp->root->data << endl ; cout << "\nMax Item:\n" ; cout << (Tptr->max())->root->data << endl ; delete Tptr ; } catch(MemoryError& e) { cerr << "Oops" << endl ; exit(1) ; } }