-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfunction.h
More file actions
43 lines (31 loc) · 774 Bytes
/
function.h
File metadata and controls
43 lines (31 loc) · 774 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
//
// Created by yoran on 2022/3/24.
//
#ifndef DATA_STRUCTURE_FUNCTION_H
#define DATA_STRUCTURE_FUNCTION_H
//与二叉树有关的数据结构
typedef struct BiTNode {
char data;
struct BiTNode* lchild, * rchild;
} BiTNode, * BiTree;
typedef struct tag {
BiTree p;
struct tag* pnext;
}tag_t, * ptag_t;
void PreOrder(BiTree P);
void InOrder(BiTree P);
void PostOrder(BiTree P);
void LevelOrder(BiTree P);
//与队列有关的数据结构
typedef struct LinkNode {
BiTree data;
struct LinkNode* next;
}LinkNode;
typedef struct {
LinkNode* front, * rear;
}LinkQueue;
void InitQueue(LinkQueue& Q);
bool isEmpty(LinkQueue Q);
bool EnQueue(LinkQueue& Q, BiTree e);
bool DeQueue(LinkQueue& Q, BiTree& e);
#endif //DATA_STRUCTURE_FUNCTION_H