循环队列空和满的判断
时间: 2023-09-17 18:10:09 浏览: 333
用标志域表示队空队满状态的循环队列的综合操作
循环队列的空和满的判断条件如下:
- 队列为空的条件是:rear == front。\[1\]
- 队列满的条件是:(rear+1) % N == front,其中N为循环队列的总长度。\[2\]
#### 引用[.reference_title]
- *1* [循环队列:判断队列空和满的3种方法](https://blog.csdn.net/lilililililiki/article/details/104317286)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [怎么判断循环队列是否为空?或者已经满了?](https://blog.csdn.net/You_are_my_dream/article/details/68068195)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文