-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
38 lines (32 loc) · 917 Bytes
/
Copy pathmain.cpp
File metadata and controls
38 lines (32 loc) · 917 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
#include <iostream>
#include "threadedBST.h"
using namespace std;
void test1() { // size 1
const int n = 1;
const ThreadedBST origTree(n); // creating a tree
ThreadedBST newTree = origTree; // copying original tree
// remove all evens from newTree
for (int i = 2; i < n + 1; i += 2) {
newTree.remove(i);
}
//output
cout << "Original Tree: " << origTree << endl;
cout << "New Tree: " << newTree << endl << endl;
}
void test2() { // size 4
const int n = 4;
ThreadedBST origTree(n); // creating a tree
ThreadedBST newTree = origTree; // copying original tree
// remove all evens from newTree
for (int i = 2; i < n + 1; i += 2) {
newTree.remove(i);
}
//output
cout << "Original Tree: " << origTree << endl;
cout << "New Tree: " << newTree << endl << endl;
}
int main() {
test1();
test2();
return 0;
}