抄下面來的~~~
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