-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbinarytree.h
More file actions
executable file
·53 lines (36 loc) · 928 Bytes
/
binarytree.h
File metadata and controls
executable file
·53 lines (36 loc) · 928 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
/*
#include <iostream>
typedef struct _BinaryTree BinaryTree_S;
typedef struct _BinaryTree* LPBinaryTree_S;
struct _BinaryTree
{
int data;
LPBinaryTree_S pLchild;
LPBinaryTree_S pRchild;
};
class BinaryTree
{
public:
BinaryTree();
~BinaryTree();
int CreateTree();
int DestroyTree();
int DestroyTheTree(LPBinaryTree_S pBTNode);
int TreeEmpty();
int TreeDepth();
int TreeDepth(LPBinaryTree_S pBTNode);
LPBinaryTree_S GetRoot();
int InsertChild(int data);
int InsertChild(LPBinaryTree_S pBTNode);
int DeleteChild(int data);
int DeleteChild(LPBinaryTree_S pBTNode);
int PreOrderTraverseTree(LPBinaryTree_S pBTNode);
int PreOrderTraverseTree();
int InOrderTraverseTree(LPBinaryTree_S pBTNode);
int InOrderTraverseTree();
int PostOrderTraverseTree(LPBinaryTree_S pBTNode);
int PostOrderTraverseTree();
private:
LPBinaryTree_S m_pRoot;
};
*/