-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtesttree.cpp
executable file
·39 lines (34 loc) · 1.11 KB
/
testtree.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
// File: stocksystem.cpp
#include <iostream>
#include <cstdlib>
#include <string>
#include "redblacktree.h"
using namespace std;
int main()
{
RedBlackTree<int>* tree = new RedBlackTree<int>();
tree->Insert(41);
cout << "root " << tree->GetRoot()->data << endl;
tree->Insert(32);
cout << "root " << tree->GetRoot()->data << endl;
tree->Insert(71);
cout << "root " << tree->GetRoot()->data << endl;
tree->Insert(65);
cout << "root " << tree->GetRoot()->data << endl;
tree->Insert(51);
cout << "root " << tree->GetRoot()->data << endl;
tree->Insert(87);
cout << "root " << tree->GetRoot()->data << endl;
tree->Insert(82);
cout << "root " << tree->GetRoot()->data << endl;
tree->Insert(93);
cout << "root " << tree->GetRoot()->data << endl;
/*
cout << "root " << tree->GetRoot()->data << endl;
tree->Remove(51);
cout << "root " << tree->GetRoot()->data << endl;
tree->Remove(32);
cout << "root " << tree->GetRoot()->data << endl;
*/
RedBlackTree<int>* copytree = new RedBlackTree<int>(*tree);
}