int Pop_Queue(SeQueue *q) { if (Empty_Queue(q)) return 0; q->num--; q->front = (q->front + 1) % MAXSIZE; return 1; }
void EnQueue(char a, Queue *Q) { if(!Full_Queue(*Q)) { if(Empty_Queue(*Q)) Q->Front = 0; Q->Rear = Q->Rear + 1; Q->elements[Q->Rear] = a; } else printf("Queue is full!\n"); }
void DeQueue(char *a, Queue *Q) { if(!Empty_Queue(*Q)) { *a = Q->elements[Q->Front]; Q->Front = Q->Front+1; if(Q->Front > Q->Rear) { MakeNull_Queue(Q); } } else printf("Queue is empty!\n"); }
datatype Top_Queue(SeQueue *q) { if (Empty_Queue(q)) return 0; return q->data[q->front]; }