当前位置:网站首页>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
边栏推荐
- Jmeter 5.5版本发布说明
- 牛客小白月赛52 E.分组求对数和(二分&容斥)
- c语言(结构体)定义一个User结构体,含以下字段:
- 学习笔记|数据小白使用DataEase制作数据大屏
- Haqi projection Black Horse posture, avec seulement six mois de forte pénétration du marché des projecteurs de 1000 yuans!
- 哈趣投影黑馬之姿,僅用半年强勢突圍千元投影儀市場!
- 2022 Android interview essential knowledge points, a comprehensive summary
- [shell] summary of common shell commands and test judgment statements
- K8s running Oracle
- FPGA课程:JESD204B的应用场景(干货分享)
猜你喜欢

Redis (II) - redis General Command

Ha Qu projection dark horse posture, only half a year to break through the 1000 yuan projector market!

【OpenCV】形态学滤波(2):开运算、形态学梯度、顶帽、黑帽

软件测试到了35岁,真的就干不动了吗?

Open the blue screen after VMware installation

A program lets you understand what static inner classes, local inner classes, and anonymous inner classes are
![[opencv] morphological filtering (2): open operation, morphological gradient, top hat, black hat](/img/45/f3b960e3c56f50674b0e6374cba705.png)
[opencv] morphological filtering (2): open operation, morphological gradient, top hat, black hat

Abnova循环肿瘤DNA丨全血分离,基因组DNA萃取分析

当前发布的SKU(销售规格)信息中包含疑似与宝贝无关的字

MySQL的安装
随机推荐
【解决】Final app status- UNDEFINED, exitCode- 16
MySQL的安装
Jmeter 5.5版本发布说明
港科大&MSRA新研究:关于图像到图像转换,Fine-tuning is all you need
项目实战 五 拟合直线 获得中线
MySQL卸载文档-Windows版
Party A's requirements for those who have lost 800 yuan
ICML 2022 | explore the best architecture and training method of language model
Leite smart home longhaiqi: from professional dimming to full house intelligence, 20 years of focus on professional achievements
线性代数(一)
隐马尔科夫模型(HMM)学习笔记
Redis(一)——初识Redis
How to set up in touch designer 2022 to solve the problem that leap motion is not recognized?
Problems and precautions about using data pumps (expdp, impdp) to export and import large capacity tables in Oracle migration
Haqi projection Black Horse posture, avec seulement six mois de forte pénétration du marché des projecteurs de 1000 yuans!
Kotlin之 Databinding 异常
偏执的非合格公司
基本Dos命令
Test the foundation of development, and teach you to prepare for a fully functional web platform environment
2022Android面试必备知识点,一文全面总结