Queue/CircularQueue.c
void printQueue(Queue* Q) {
    // 要知道队列当前有多少个元素
    int length = (Q->rear - Q->front + MAXSIZE) % MAXSIZE;
    int index = Q->front;
    for (int i = 0; i < length; i++) {
        printf("%d -> ", Q->data[index]);
        index = (index + 1) % MAXSIZE;
    }
    printf("NULL\n");
}
/**
 * print all items in queue
 * @param Q the pointer of queue
 */
print all items in queue
@param Q the pointer of queue
print all items in queue @param Q the pointer of queue
void printQueue(Queue* Q) {
    int length = (Q->rear - Q->front + MAXSIZE) % MAXSIZE;
    int index = Q->front;
    for (int i = 0; i < length; i++) {
        printf("%d -> ", Q->data[index]);
        index = (index + 1) % MAXSIZE;
    }
    printf("NULL\n");
}
void printQueue ( Queue * Q ) { int length = ( Q -> rear - Q -> front + MAXSIZE ) % MAXSIZE ; int index = Q -> front ; for ( int i = 0 ; i < length ; i ++ ) { printf ( " " , Q -> data [ index ] ) ; index = ( index + 1 ) % MAXSIZE ; } printf ( " \n " ) ; }
print all items in queue
 @param Q the pointer of queue
print all items in queue @param Q the pointer of queue
// 要知道队列当前有多少个元素