-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathBTree.cpp
More file actions
70 lines (55 loc) · 972 Bytes
/
BTree.cpp
File metadata and controls
70 lines (55 loc) · 972 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
60
61
62
63
64
65
66
67
68
69
70
#include <iostream>
using namespace std;
#include "BTree.h"
int main()
{
BTree<int> bt(4);
bt.insert(21);
bt.insert(48);
bt.insert(72);
bt.insert(12);
bt.insert(22);
bt.insert(50);
bt.insert(34);
bt.insert(42);
bt.insert(60);
bt.insert(67);
bt.insert(89);
bt.insert(13);
bt.display();
cout << "delete 50\n\n";
bt.remove(50);
bt.display();
cout << "delete 72\n\n";
bt.remove(72);
bt.display();
cout << "delete 89\n\n";
bt.remove(89);
bt.display();
cout << "delete 67\n\n";
bt.remove(67);
bt.display();
cout << "delete 48\n\n";
bt.remove(48);
bt.display();
cout << "delete 60\n\n";
bt.remove(60);
bt.display();
cout << "delete 42\n\n";
bt.remove(42);
bt.display();
cout << "delete 22\n\n";
bt.remove(22);
bt.display();
cout << "delete 34\n\n";
bt.remove(34);
bt.display();
cout << "delete 21\n\n";
bt.remove(21);
bt.display();
// int i;
// for (i = 0; i < 30; ++i)
// bt.insert(i);
printf("233");
return 0;
}