diff --git a/queue.c b/queue.c index 4ebd3f3205acb43c319ccfeccd83f865fca289c9..8ddd1279986ee5092a55544887e4e36335b09bc1 100644 --- a/queue.c +++ b/queue.c @@ -1 +1,6 @@ #include "queue.h" + +bool is_empty(queue q){ + return (q.tail<0); +} + diff --git a/queue.h b/queue.h index bf57235a8588b9dfa4adc0e714b7cab103aa4007..12a77cbfc5513916871595a0792e3f86a609fa0f 100644 --- a/queue.h +++ b/queue.h @@ -1,3 +1,4 @@ +#include <stdbool.h> #ifndef _QUEUE_H_ #define _QUEUE_H_ @@ -6,4 +7,6 @@ typedef struct _queue { int *data; } queue; +bool is_empty(queue q); + #endif