forked from andesyv/BinaryTree
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
53 lines (43 loc) · 1.32 KB
/
Copy pathmain.cpp
File metadata and controls
53 lines (43 loc) · 1.32 KB
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
#include <iostream>
#include "binarytree.h"
#include "smartbinarytree.h"
#include <vector>
#include <stack>
#include <cmath>
using namespace DuckyTools;
int main()
{
SmartBinaryTree<int> tree{7, 5, 5, 6, 12, 3, 9, 1, 2, 15, 1, 18, 8, 22, 13, -2};
// SmartBinaryTree<int> tree{};
// tree.buildFromGround(10);
/*
tree.insert(7);
tree.insert(5);
tree.insert(5);
tree.insert(6);
tree.insert(12);
tree.insert(3);
tree.insert(9);
tree.insert(1);
tree.insert(2);
//*/
std::cout << "See! A message!" << std::endl;
tree.printDepth();
std::cout << "There are " << tree.countNodes() << " nodes in the tree." << std::endl;
std::cout << "There is " << tree.freeSpace() << " free space(s) in the tree!" << std::endl;
tree.SmartPrintTree(nullptr);
/*
tree.remove(5);
tree.printDepth();
std::cout << "There are " << tree.countNodes() << " nodes in the tree." << std::endl;
std::cout << "There is " << tree.freeSpace() << " free space(s) in the tree!" << std::endl;
tree.inTrav();
std::cout << "And then... " << std::endl;
tree.inTrav();
// tree.root = nullptr;
std::cout << "See! Another message!" << std::endl;
tree.print();
std::cout << "There are " << tree.countNodes() << " nodes in the tree." << std::endl;
//*/
return 0;
}