当前位置:网站首页>Stack and queue-p79-9
Stack and queue-p79-9
2022-07-07 06:34:00 【DanStevensBigFan】

The maximum capacity of the queue is MaxSize
This sentence does not mean that the number of elements when the queue is full is MaxSize

In this case, the maximum capacity is MaxSize
No other data members have been requested
The condition for judging the queue is Q.front == (Q.rear+1)%MaxSize
explain
Popular explanation ,(Q.rear+1)%MaxSize Represents in the loop queue (rear Value +1)
From the image, it is the current rear The next object of the object pointed to
%MaxSize Important properties of loops
Try a few more pictures , And substitute numbers

This method has additional data members size As the companion variable of the queue

This method has additional data members tag As companion variables for insert and delete operations
So from the three figures, it can be concluded that no other data members that meet the meaning of the question are Figure 1 , Waste a piece of memory
That is to say Q.front == (Q.rear+1)%MaxSize
边栏推荐
- Developers don't miss it! Oar hacker marathon phase III chain oar track registration opens
- Symmetric binary tree [tree traversal]
- Ant manor safety helmet 7.8 ant manor answer
- dolphinscheduler3.x本地启动
- 项目实战 五 拟合直线 获得中线
- 「运维有小邓」符合GDPR的合规要求
- 偏执的非合格公司
- 对称的二叉树【树的遍历】
- 博士申请 | 上海交通大学自然科学研究院洪亮教授招收深度学习方向博士生
- dolphinscheduler3. X local startup
猜你喜欢

Go straight to the 2022ecdc fluorite cloud Developer Conference: work with thousands of industries to accelerate intelligent upgrading

Redis (I) -- getting to know redis for the first time

哈趣投影黑馬之姿,僅用半年强勢突圍千元投影儀市場!

Learning notes | data Xiaobai uses dataease to make a large data screen
![[FPGA] EEPROM based on I2C](/img/28/f4f2efda4b5feb973c9cf07d9d908f.jpg)
[FPGA] EEPROM based on I2C

The difference between string constants and string objects when allocating memory

Common problems of caching in high concurrency scenarios

安装VMmare时候提示hyper-v / device defender 侧通道安全性

FPGA课程:JESD204B的应用场景(干货分享)

FlexRay通信协议概述
随机推荐
MySQL卸载文档-Windows版
[Shell]常用shell命令及测试判断语句总结
FPGA课程:JESD204B的应用场景(干货分享)
Can't you really do it when you are 35 years old?
微信小程序隐藏video标签的进度条组件
Apache ab 压力测试
Niuke Xiaobai monthly race 52 E. sum logarithms in groups (two points & inclusion and exclusion)
力扣62 不同路径(从矩阵左上到右下的所有路径数量) (动态规划)
MySQL (x)
C language sorting (to be updated)
Wechat applet hides the progress bar component of the video tag
[SOC FPGA] peripheral PIO button lights up
C language (structure) defines a user structure with the following fields:
Kotlin之 Databinding 异常
360 Zhiyu released 7.0 new products to create an exclusive "unified digital workspace" for the party, government and army, and central and state-owned enterprises
ST表预处理时的数组证明
Learning notes | data Xiaobai uses dataease to make a large data screen
Linear algebra (1)
uniapp开发小程序如何使用微信云托管或云函数进行云开发
Ant manor safety helmet 7.8 ant manor answer