-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLinkQueue.h
45 lines (39 loc) · 1019 Bytes
/
LinkQueue.h
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
/*
* =====================================================================================
*
* Filename: LinkQueue.h
*
* Description: 队列的链式存储实现
*
* Version: 1.0
* Created: 11/30/2014 12:31:46 PM
* Revision: none
* Compiler: gcc
*
* Author: 张世龙 (mn), [email protected]
* Company: free
*
* =====================================================================================
*/
#ifndef GIT_JCOMMON_LINKQUEUE_H
#define GIT_JCOMMON_LINKQUEUE_H
typedef int ElemType;
typedef struct QNode
{
ElemType data;
struct QNode *next;
}QNode,*QueuePtr;
typedef struct
{
int count;
QNode *front,*rear;
} LinkQueue;
void InitQueue(LinkQueue *queue);
void DestoryQueue(LinkQueue *queue);
void ClearQueue(LinkQueue *queue);
int QueueEmpty(LinkQueue *queue);
int GetHead(LinkQueue *queue,ElemType *e);
int EnQueue(LinkQueue *queue,ElemType *e);
int DeQueue(LinkQueue *queue,ElemType *e);
int QueueLength(LinkQueue *queue);
#endif