当前位置:网站首页>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
边栏推荐
- JVM 全面深入
- UIC (configuration UI Engineering) public file library adds 7 industry materials
- Experience sharing of contribution of "management world"
- 精准时空行程流调系统—基于UWB超高精度定位系统
- dolphinscheduler3. X local startup
- Shared memory for interprocess communication
- Common problems of caching in high concurrency scenarios
- Abnova 免疫组化服务解决方案
- 快速定量,Abbkine 蛋白质定量试剂盒BCA法来了!
- Matlab / envi principal component analysis implementation and result analysis
猜你喜欢

LM小型可编程控制器软件(基于CoDeSys)笔记二十三:伺服电机运行(步进电机)相对坐标转换为绝对坐标

雷特智能家居龙海祁:从专业调光到全宅智能,20年专注成就专业

Redis(二)—Redis通用命令

ETCD数据库源码分析——从raftNode的start函数说起

3531. Huffman tree

Redis(一)——初识Redis

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

2022 Android interview essential knowledge points, a comprehensive summary
![[SOC FPGA] custom IP PWM breathing lamp](/img/4b/5053137cf95e851ca89057e9b9c15c.jpg)
[SOC FPGA] custom IP PWM breathing lamp

港科大&MSRA新研究:关于图像到图像转换,Fine-tuning is all you need
随机推荐
docker-compose启动redis集群
UIC(组态UI工程)公版文件库新增7款行业素材
Redis (I) -- getting to know redis for the first time
雷特智能家居龙海祁:从专业调光到全宅智能,20年专注成就专业
Open the blue screen after VMware installation
Several key steps of software testing, you need to know
快速定量,Abbkine 蛋白质定量试剂盒BCA法来了!
项目实战 五 拟合直线 获得中线
JWT certification
matlab / ENVI 主成分分析实现及结果分析
JWT 认证
Performance comparison between Ceres solver and g2o
Learning notes | data Xiaobai uses dataease to make a large data screen
Can't you really do it when you are 35 years old?
Experience sharing of contribution of "management world"
FPGA课程:JESD204B的应用场景(干货分享)
对称的二叉树【树的遍历】
MySQL installation
Abnova 膜蛋白脂蛋白体技术及类别展示
Etcd database source code analysis -- starting from the start function of raftnode