-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestBST.cpp
More file actions
59 lines (48 loc) · 962 Bytes
/
TestBST.cpp
File metadata and controls
59 lines (48 loc) · 962 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include "BST.h"
int main(int argc, char const *argv[])
{
BST bst;
bst.insert(6);
bst.insert(2);
bst.insert(10);
bst.insert(-1);
bst.insert(4);
bst.insert(3);
bst.insert(5);
bst.insert(11);
bst.insert(12);
bst.inorder_print();
bst.preorder_print();
cout << endl;
bst.remove(2);
cout << "= remove 2 :" << endl;
bst.inorder_print();
bst.preorder_print();
cout << endl;
bst.remove(3);
cout << "= remove 3 :" << endl;
bst.inorder_print();
bst.preorder_print();
cout << endl;
bst.remove(4);
cout << "= remove 4 :" << endl;
bst.inorder_print();
bst.preorder_print();
cout << endl;
bst.remove(-1);
cout << "= remove -1 :" << endl;
bst.inorder_print();
bst.preorder_print();
cout << endl;
bst.remove(10);
cout << "= remove 10 :" << endl;
bst.inorder_print();
bst.preorder_print();
cout << endl;
bst.remove(14);
cout << "= remove 14 :" << endl;
bst.inorder_print();
bst.preorder_print();
cout << endl;
return 0;
}