-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathqueue.h
44 lines (34 loc) · 809 Bytes
/
queue.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
/* new variable types declaration */
#ifndef QUEUE_H
#define QUEUE_H
// point
typedef struct __pnt__
{
int row;
int col;
} pnt;
// element
typedef struct __elem__
{
pnt point;
struct __elem__ *next;
} elem;
// queue of element
typedef struct __queue__
{
elem *first;
elem *last;
int length;
} queue;
// global variables declaration
// global functions declaration
extern queue *create_empty_queue ( void );
extern queue **create_empty_array_of_queue ( int );
extern void append ( int, int, queue * );
extern void array_append ( int, int, int, queue ** );
extern elem *pop ( queue * );
extern void populate ( int, queue * );
extern void print_queue ( queue * );
extern void print_array_of_queue ( queue **, int );
extern void free_queue ( queue * );
#endif /* QUEUE_H */