19#define QUEUE_EMPTY (-1)
struct node node_t
A node in the singly linked list.
bool enqueue(queue *q, int value)
Insert a new value at the end of the queue.
Definition queue.c:11
int dequeue(queue *q)
Remove and return the value at the front of the queue.
Definition queue.c:26
struct node node_t
Node structure for the queue.
void printqueue(queue *q)
Print the contents of the queue to stdout.
Definition queue.c:38
void init_queue(queue *q)
Initialize a queue.
Definition queue.c:6
A node in the singly linked list.
Definition linkedlist.h:22
struct node * next
Pointer to the next node in the list.
Definition linkedlist.h:24
int value
The integer value stored in the node.
Definition linkedlist.h:23
Queue structure.
Definition queue.h:36
node_t * head
Pointer to the first node in the queue.
Definition queue.h:37
node_t * tail
Pointer to the last node in the queue.
Definition queue.h:38