forked from hacktoberfest17/programming
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
48 lines (36 loc) · 910 Bytes
/
main.cpp
File metadata and controls
48 lines (36 loc) · 910 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
#include <iostream>
#include <string>
#include "BinaryTree.h"
using namespace std;
int main() {
Node *root = new Node(0);
BinaryTree b(root);
Node *r1 = new Node(1);
Node *r2 = new Node(2);
Node *r3 = new Node(3);
Node *r4 = new Node(4);
Node *r5 = new Node(5);
Node *l1 = new Node(1);
Node *l2 = new Node(2);
Node *l3 = new Node(3);
Node *l4 = new Node(4);
Node *l5 = new Node(5);
root->AddBranchRight(r1);
root->AddBranchLeft(l1);
r1->AddBranchRight(r3);
r1->AddBranchLeft(l3);
r3->AddBranchRight(r5);
r3->AddBranchLeft(l5);
l1->AddBranchRight(r2);
l1->AddBranchLeft(l2);
r2->AddBranchRight(r4);
l2->AddBranchLeft(l4);
b.PrintBranches(root,0);
string s = "";
cout << "Type anything then press enter to exit: ";
cin >> s;
if (s == "anything") {
cout << "LOL";
}
return 0;
}