-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStackQueue.h
55 lines (35 loc) · 1.02 KB
/
StackQueue.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
46
47
48
49
50
51
52
53
54
55
#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include "maze.h"
#define QueueMaxSize 100
typedef char QueueType;
typedef struct SeqQueue
{
QueueType data[QueueMaxSize];
size_t tail;
size_t head;
size_t size;
}SeqQueue;
void SeqQueueInit(SeqQueue* q);
void SeqQueueDestory(SeqQueue* q);
void SeqQueuePush(SeqQueue* q, QueueType value);
void SeqQueuePop(SeqQueue* q);
int SeqQueueFront(SeqQueue* q, QueueType* value);
size_t SeqQueueSize(SeqQueue* q);
typedef struct Point SeqStackType;
#define SeqStackMaxSize 1000
typedef struct SeqStack
{
SeqStackType data[SeqStackMaxSize];
size_t size;
}SeqStack;
void SeqStackInit(SeqStack* stack);
void SeqSatckDestory(SeqStack* stack);
void SeqStackPush(SeqStack* stack, SeqStackType value);
void SeqStackPop(SeqStack* stack);
int SeqStackTop(SeqStack* stack, SeqStackType* value);
size_t SeqStackSize(SeqStack* stack);
void SeqStackAssign(SeqStack* dst,SeqStack* src);
void SeqStackDebugPrint(SeqStack* stack);