#include #include "queue.h" #define FALSE 0 #define TRUE !FALSE #define MAXQUEUESIZE 5 /* need one more element than in queue.c */ struct queue { int elems[MAXQUEUESIZE]; int first; /* index of the head of the queue */ int last; /* index of the empty space following the last item in the queue */ } myQueue; /* return an empty queue */ struct queue *init ( ) { myQueue.first = myQueue.last = 0; return &myQueue; } /* return true if the queue is empty */ int isEmpty (struct queue *q) { return q->first == q->last; } /* add an element to the end of the queue */ struct queue * enqueue (int val, struct queue *q) { /* You fill this in. */ return q; } /* remove the front of the queue; do nothing if the queue is empty */ struct queue * dequeue (struct queue *q) { /* You fill this in. */ return q; } /* return the front of the queue; undefined result if the queue is empty */ int front (struct queue *q) { return q->elems[q->first]; } /* print the queue */ void print (struct queue *q) { /* You fill this in. */ }