-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
60 lines (50 loc) · 1.16 KB
/
main.cpp
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
60
/* Rachel Prusacki
* Project3-Driver Program
* COSC220, 11/30/2021
*/
#include "project3_bstree.h"
#include <iostream>
using namespace std;
int main () {
stree<int> list = stree<int>();
list.insert(10);
list.insert(25);
list.insert(26);
list.insert(28);
list.insert(29);
list.insert(30);
list.insert(34);
list.insert(35);
list.insert(40);
list.insert(50);
list.insert(65);
cout << "Original:" << endl;
list.displayTree();
cout << "\nDelete 25: " << endl;
list.erase(26);
list.displayTree();
cout << "\nDelete 35: " << endl;
list.erase(35);
list.displayTree();
cout << "\nDelete 30: " << endl;
list.erase(30);
list.displayTree();
//Copying from array:
char arr[] = {'S', 'J', 'K', 'L', 'X', 'F', 'E', 'Z'};
char * first = &arr[0];
char * last = &arr[8];
stree<char> clist = stree<char>(first, last);
cout << "\nOriginal:" << endl;
clist.displayTree();
cout << "\nInsert H:" << endl;
clist.insert('H');
clist.displayTree();
cout << "\nDelete F:" << endl;
clist.erase('F');
clist.displayTree();
cout << "\nMin of Tree1:" << endl;
cout << list.min() << endl;
cout << "\nMin of Tree2:" << endl;
cout<< clist.min() << endl;
return 0;
}