-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelper.cpp
55 lines (43 loc) · 1.35 KB
/
helper.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//#include "binarytrees.h"
#include"bst.h"
#include<iostream>
using namespace std;
int main(){
BST newly;
newly.add(35);
newly.add(89);
newly.add(22);
newly.add(-99);
newly.add(-1);
// newly.add(22);
newly.add(78);
newly.add(95);
newly.add(56);
newly.add(45);
newly.add(88);
newly.add(-144);
newly.printsideways();
cout<<endl<<"The minimum number in the whole tree is ";
newly.getmin();
return 0;
// TreeNode* node= new TreeNode(42);
// node->left=new TreeNode(59);
// node->left->left=new TreeNode(22);
// node->left->right=new TreeNode(64);
// node->right=new TreeNode(27);
// node->right->right=new TreeNode(86);
// node->right->left=new TreeNode(32);
// node->right->right->left=new TreeNode(-1);
// BinaryTrees tree(node);
// cout<<"=============Tree=============="<<endl;
// tree.print();
// cout<<endl;
// tree.printsideways();
//// cout<<"===========Contains============"<<endl;
//// cout<<"Contains 27? "<<boolalpha<<tree.contains(27)<<endl;
//// cout<<"Contains 86? "<<tree.contains(86)<<endl;
//// cout<<"Contains 33? "<<tree.contains(33)<<endl;
//// cout<<"Contains -99? "<<tree.contains(-99)<<endl;
//// cout<<"Contains 1? "<<tree.contains(1)<<endl;
//// cout<<"Contains 42? "<<tree.contains(42)<<endl;
}