当前位置:网站首页>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
边栏推荐
- JWT 认证
- 博士申请 | 上海交通大学自然科学研究院洪亮教授招收深度学习方向博士生
- matlab / ENVI 主成分分析实现及结果分析
- C language (structure) defines a user structure with the following fields:
- String (explanation)
- PostgreSQL database timescaledb function time_ bucket_ Gapfill() error resolution and license replacement
- 线性代数(一)
- rt-thread 中对 hardfault 的处理
- How to set up in touch designer 2022 to solve the problem that leap motion is not recognized?
- dolphinscheduler3. X local startup
猜你喜欢
Ha Qu projection dark horse posture, only half a year to break through the 1000 yuan projector market!
基于FPGA的VGA协议实现
JMeter function assistant - random value, random string, fixed value random extraction
Matlab / envi principal component analysis implementation and result analysis
Doctoral application | Professor Hong Liang, Academy of natural sciences, Shanghai Jiaotong University, enrolls doctoral students in deep learning
Programmers' daily | daily anecdotes
FlexRay通信协议概述
学术报告系列(六) - Autonomous Driving on the journey to full autonomy
博士申请 | 上海交通大学自然科学研究院洪亮教授招收深度学习方向博士生
How can I check the DOI number of a foreign document?
随机推荐
Array proof during st table preprocessing
Tkinter window selects PCD file and displays point cloud (open3d)
微信小程序隐藏video标签的进度条组件
[SOC FPGA] custom IP PWM breathing lamp
PostgreSQL database timescaledb function time_ bucket_ Gapfill() error resolution and license replacement
Several key steps of software testing, you need to know
【OpenCV】形态学滤波(2):开运算、形态学梯度、顶帽、黑帽
Redis(一)——初识Redis
Crudini profile editing tool
FlexRay通信协议概述
缓存在高并发场景下的常见问题
精准时空行程流调系统—基于UWB超高精度定位系统
[FPGA] EEPROM based on I2C
软件测试到了35岁,真的就干不动了吗?
地质学类比较有名的外文期刊有哪些?
c语言(结构体)定义一个User结构体,含以下字段:
力扣62 不同路径(从矩阵左上到右下的所有路径数量) (动态规划)
js装饰器@decorator学习笔记
二十岁的我4面拿到字节跳动offer,至今不敢相信
docker-compose启动redis集群