-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbintree.h
More file actions
58 lines (43 loc) · 1.04 KB
/
bintree.h
File metadata and controls
58 lines (43 loc) · 1.04 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
54
55
56
57
/*********************
Name: Kendall Shearman
Coding 06
Purpose: Binary Tree
**********************/
#ifndef BINTREE_BINTREE_H
#define BINTREE_BINTREE_H
#include "data.h"
#include <iostream>
using std::endl;
using std::cout;
class BinTree {
public:
BinTree();
~BinTree();
bool isEmpty();
int getCount();
bool getRootData(Data*);
void displayTree();
void clear();
bool addNode(int, string);
bool removeNode(int);
bool getNode(Data*, int);
bool contains(int);
int getHeight();
void displayPreOrder();
void displayPostOrder();
void displayInOrder();
private:
void clear(DataNode*);
bool addNode(DataNode*, DataNode**);
DataNode* removeNode(int, DataNode*);
bool getNode(Data*, int, DataNode*);
bool contains(int, DataNode*);
int getHeight(DataNode*);
void displayPreOrder(DataNode*);
void displayPostOrder(DataNode*);
void displayInOrder(DataNode*);
DataNode* minValueNode(DataNode*);
DataNode *root;
int count;
};
#endif /* BINTREE_BINTREE_H */