// Course: CS 14 // Lecture Section: 1 // Lab Section: Enter your lab section number here (21, 22, etc) // Assignment #: LAB 7 // First Name: Enter your FIRST name here (eg, John) // Last Name: Enter your LAST name here (eg, Doe) // ID Number: Enter your ID number here (eg, 12-345-678) // Email address: Enter your UCR email address here (eg, jdoe@cs.ucr.edu) // =============================================================== #include #include "BST.h" using namespace std; // display the item key void display(TreeItemType& anItem) { cout << anItem.getKey() << endl; } // read from console the tree values void storeTreeNodes(BinarySearchTree& tree) { int value; // node value cout << "Enter a positive value (negative value to stop): " ; cin >> value; while (value > -1) { tree.searchTreeInsert(value); cout << "Enter a positive value (negative value to stop): " ; cin >> value; } } int main() { BinarySearchTree aTree; storeTreeNodes(aTree); int low, high; cout << endl << "-------------------------------------------------" << endl; cout << "IN ORDER TRAVERSE: "<< endl; aTree.inorderTraverse(display); return 0; }