#include #include using namespace std; int main() { binarySearchTree T; T.insert(54); T.insert(22); T.insert(69); T.insert(89); T.insert(43); T.insert(82); T.insert(90); T.insert(13); T.insert(66); T.insert(96); T.insert(39); T.insert(11); T.insert(5); T.insert(98); T.insert(20); T.insert(85); T.insert(83); T.insert(87); //Implement a 'double extractMin(node * p)' method that removes and //returns the smallest item in the tree rooted at node p, as well as a public //shell method 'double extractMin()' that removes and returns the smallest item //in the tree. cout << T.extractMin() << endl; //5 cout << T.extractMin() << endl; //11 cout << T.extractMin() << endl; //13 //Also implement extractMax() cout << T.extractMax() << endl; //98 T.display(); //20 22 39 43 54 66 69 82 83 85 87 89 90 96 //Implement 'void remove(double x)' T.remove(87); T.remove(96); T.remove(89); T.remove(54); T.display(); //20 22 39 43 66 69 82 83 85 90 98 return 0; }