-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqueue.h
More file actions
37 lines (28 loc) · 872 Bytes
/
Copy pathqueue.h
File metadata and controls
37 lines (28 loc) · 872 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
#ifndef _queue_h
#define _queue_h
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include "car.h"
typedef Car* queueType;
typedef struct LLNode
{
queueType qt; //queueType contained in this node
struct LLNode *pNext; //pointer to the next node in the linked list
} LLNode;
typedef struct Queue
{
LLNode *qFront; //pointer to the first element of the queue
LLNode *qRear; //pointer to the last element of the queue
int numElements; //number of elements in this Queue
} Queue;
Queue *createQueue( );
void freeQueue( Queue *pq );
queueType getNext( Queue *pq );
queueType dequeue( Queue *pq );
queueType front( Queue *pq );
void enqueue( Queue *pq, queueType qt );
void mergeQueues( Queue *to, Queue *from );
bool isEmpty( Queue *pq );
int getNumElements( Queue *pq );
#endif