栈:后进先出(last in first out)的线性表(简称LIFO结构)。
队列:先进先出(first in first out, FIFO)的线性表。
循环队列:
队尾rear=(rear+1)%Maxsize
队首front=(front+1)%Maxsize
队空:rear=front
队满:(rear+1)%Maxsize=front
队中元素个数:
count=(rear-front+maxsize)%maxsize
rear=(rear+count)%maxsize
front=(rear-count+maxsize)%maxsize