实现链队类
This commit is contained in:
@@ -3,5 +3,23 @@
|
||||
#ifndef LINKQUEUE_H
|
||||
#define LINKQUEUE_H
|
||||
|
||||
typedef struct Node {
|
||||
int data;
|
||||
Node *next;
|
||||
} Node, *LinkList;
|
||||
|
||||
typedef struct {
|
||||
LinkList list;
|
||||
Node *front;
|
||||
Node *rear;
|
||||
} linkQueue;
|
||||
|
||||
void initQueue(linkQueue &q);
|
||||
|
||||
bool isEmpty(linkQueue &q);
|
||||
|
||||
bool enQueue(linkQueue &q, int e);
|
||||
|
||||
int deQueue(linkQueue &q);
|
||||
|
||||
#endif //LINKQUEUE_H
|
||||
|
||||
Reference in New Issue
Block a user