12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- #ifndef _QUEUE_H_
- #define _QUEUE_H_
- #include <stdbool.h>
- typedef struct item
- {
- long arrive;
- int processtime;
- } Item;
-
- #define MAXQUEUE 10
- typedef struct node
- {
- Item item;
- struct node * next;
- } Node;
- typedef struct queue
- {
- Node * front;
- Node * rear;
- int items;
- } Queue;
- void InitializeQueue(Queue * pq);
- bool QueueIsFull(const Queue * pq);
- bool QueueIsEmpty(const Queue *pq);
- int QueueItemCount(const Queue * pq);
- bool EnQueue(Item item, Queue * pq);
- bool DeQueue(Item *pitem, Queue * pq);
- void EmptyTheQueue(Queue * pq);
- #endif
|