循环队列的一些计算
抄下面来的~~~
https://www.cnblogs.com/shenckicc/p/7411734.html
循环队列的相关条件和公式:
1.队空条件:
rear==front
2.队满条件:
(rear+1) %QueueSize==front,其中QueueSize为循环队列的最大长度
3.计算队列长度:
(rear-front+QueueSize)%QueueSize
4.入队:
(rear+1)%QueueSize
5.出队:
(front+1)%QueueSize