-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
33 lines (32 loc) · 816 Bytes
/
Copy pathmain.cpp
File metadata and controls
33 lines (32 loc) · 816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "BST.h"
int main()
{
BST<int>* bst = new BST<int>();
bst->add(11);
bst->add(1);
bst->add(6);
bst->add(-1);
bst->add(-10);
bst->add(100);
bst->print();
cout << endl;
bst->printLevelOrder();
cout << "100 in BST? true (1) or false (0): " << bst->contains(100) << endl;
cout << "9 in BST? true (1) or false (0): " << bst->contains(9) << endl;
cout << "Nodes count: " << bst->nodesCount();
cout << endl;
cout << "Height: " << bst->height();
cout << endl;
cout << "Max path: ";
bst->printMaxPath();
cout << endl;
bst->deleteValue(11);
cout << "After 11 removed: ";
bst->print();
cout << endl;
bst->printLevelOrder();
cout << "Nodes count: " << bst->nodesCount();
cout << endl;
delete bst;
return 0;
}