I. Team Concept
A queue is also a type of table, but it is a type of restricted table. It can only be inserted from one end, and the other end is thick.
Ii. Queue Array Implementation
#define QMAXSIZE 100typedef int Position;typedef int QElement;typedef struct queue{ QElement Els[QMAXSIZE]; Position head,tail;}Queue;void QCreate(Queue &Q){ Q.head = Q.tail = 0;}void Enqueue(QElement e,Queue &Q){ if((Q.tail + 1) % QMAXSIZE == Q.head) { printf("Queue Full"); } else { Q.Els[Q.tail] = e; Q.tail = (Q.tail + 1)% QMAXSIZE; }}void Dequeue(QElement &e,Queue &Q){ if(Q.head == Q.tail) { printf("Queue Empty"); } else { e = Q.Els[Q.head]; Q.head = (Q.head + 1) % QMAXSIZE; }}QElement Head(Queue Q){ if(Q.tail == Q.head ) { printf("Queue Empty"); } else { return Q.Els[Q.head]; }}bool Empty(Queue Q){ return(Q.tail == Q.head );}bool Full(Queue Q){ return((Q.tail + 1) % QMAXSIZE == Q.head );}