当前位置:网站首页>Stack and queue-p78-8 [2011 unified examination true question]
Stack and queue-p78-8 [2011 unified examination true question]
2022-07-07 06:34:00 【DanStevensBigFan】


Reading questions : Queue non-empty time ,front Point to the team header element ,rear Point to the end element
reflection :
common , commonly rear Point to the next... Of the tail element
To store elements is to store them first rear Memory pointed to ,
And then move rear Next person
however , subject rear Point to the end element
Then the storage element is moved first rear To next
Then store the element in rear The space in question
reflection :
When will it be modified front,rear value
When inserting, it will be modified rear value ,rear Value meeting +1
When deleting, it will be modified front value ,front Value meeting +1
obtain front The initial value of the :
The first element to enter the queue is stored in A[0]
When the queue is not empty ,front Point to the team header element ,rear Point to the end element
that front = 0,rear = 0 【 Note that this is after inserting the first element front, and rear value 】
【 The title requires the initial front Values and rear value 】
The first element to enter the queue is stored in A[0]
This operation is an insert operation , influence rear value , No effect front value
At the beginning front The value is 0
initial rear How to get the value
subject rear Point to the end element
Then the storage element is moved first rear To next
Then store the element in rear The space in question
in other words rear Is to move to the next position first , Only then 0
Then there is no insertion A[0] The value of time should be 0 My last
This queue is a circular queue
that 0 The last one is n-1
边栏推荐
- Software testing knowledge reserve: how much do you know about the basic knowledge of "login security"?
- [FPGA] EEPROM based on I2C
- Handling hardfault in RT thread
- 2022Android面试必备知识点,一文全面总结
- matlab / ENVI 主成分分析实现及结果分析
- [Shell]常用shell命令及测试判断语句总结
- 3531. Huffman tree
- 微信小程序隐藏video标签的进度条组件
- ST表预处理时的数组证明
- JWT certification
猜你喜欢

Can't you really do it when you are 35 years old?

dolphinscheduler3.x本地启动

Tkinter window selects PCD file and displays point cloud (open3d)
![[start from scratch] detailed process of deploying yolov5 in win10 system (CPU, no GPU)](/img/77/bd80ed602208be6a9ef8be60c6ad06.png)
[start from scratch] detailed process of deploying yolov5 in win10 system (CPU, no GPU)

Doctoral application | Professor Hong Liang, Academy of natural sciences, Shanghai Jiaotong University, enrolls doctoral students in deep learning

Jmeter 5.5版本发布说明

2022Android面试必备知识点,一文全面总结

力扣62 不同路径(从矩阵左上到右下的所有路径数量) (动态规划)

Unable to debug screen program with serial port

Abnova 体外转录 mRNA工作流程和加帽方法介绍
随机推荐
肿瘤免疫治疗研究丨ProSci LAG3抗体解决方案
C language interview to write a function to find the first occurrence of substring m in string n.
LM小型可编程控制器软件(基于CoDeSys)笔记二十三:伺服电机运行(步进电机)相对坐标转换为绝对坐标
Unity C# 函数笔记
如何解决数据库插入数据显示SQLSTATE[HY000]: General error: 1364 Field ‘xxxxx‘ doesn‘t have a default value错误
【从零开始】win10系统部署Yolov5详细过程(CPU,无GPU)
C language sorting (to be updated)
c语言(结构体)定义一个User结构体,含以下字段:
微信小程序隐藏video标签的进度条组件
牛客小白月赛52 E.分组求对数和(二分&容斥)
uniapp开发小程序如何使用微信云托管或云函数进行云开发
Matlab / envi principal component analysis implementation and result analysis
Programmers' daily | daily anecdotes
Abnova 免疫组化服务解决方案
博士申请 | 上海交通大学自然科学研究院洪亮教授招收深度学习方向博士生
【OpenCV】形态学滤波(2):开运算、形态学梯度、顶帽、黑帽
JWT 认证
Haqi projection Black Horse posture, avec seulement six mois de forte pénétration du marché des projecteurs de 1000 yuans!
C language interview to write a function to find the first public string in two strings
UIC(组态UI工程)公版文件库新增7款行业素材