当前位置:网站首页>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
边栏推荐
- 怎样查找某个外文期刊的文献?
- Which foreign language periodicals are famous in geology?
- 地质学类比较有名的外文期刊有哪些?
- ICML 2022 | explore the best architecture and training method of language model
- 请问如何查一篇外文文献的DOI号?
- Abnova 膜蛋白脂蛋白体技术及类别展示
- Postgresql中procedure支持事务语法(实例&分析)
- Postgresql源码(60)事务系统总结
- 当前发布的SKU(销售规格)信息中包含疑似与宝贝无关的字
- Unity C# 函数笔记
猜你喜欢
![[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

Unable to debug screen program with serial port
![[FPGA] EEPROM based on I2C](/img/28/f4f2efda4b5feb973c9cf07d9d908f.jpg)
[FPGA] EEPROM based on I2C

dolphinscheduler3.x本地启动

博士申请 | 上海交通大学自然科学研究院洪亮教授招收深度学习方向博士生

FlexRay通信协议概述

Haqi projection Black Horse posture, avec seulement six mois de forte pénétration du marché des projecteurs de 1000 yuans!

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

Test the foundation of development, and teach you to prepare for a fully functional web platform environment

循环肿瘤细胞——Abnova 解决方案来啦
随机推荐
【解决】Final app status- UNDEFINED, exitCode- 16
[start from scratch] detailed process of deploying yolov5 in win10 system (CPU, no GPU)
Redis (I) -- getting to know redis for the first time
Basic DOS commands
开发者别错过!飞桨黑客马拉松第三期链桨赛道报名开启
安装VMmare时候提示hyper-v / device defender 侧通道安全性
力扣62 不同路径(从矩阵左上到右下的所有路径数量) (动态规划)
Install mongodb database
缓存在高并发场景下的常见问题
LM11丨重构K线构建择时交易策略
Party A's requirements for those who have lost 800 yuan
FPGA课程:JESD204B的应用场景(干货分享)
c语言(结构体)定义一个User结构体,含以下字段:
快速定量,Abbkine 蛋白质定量试剂盒BCA法来了!
当前发布的SKU(销售规格)信息中包含疑似与宝贝无关的字
3531. Huffman tree
Haqi projection Black Horse posture, avec seulement six mois de forte pénétration du marché des projecteurs de 1000 yuans!
ST表预处理时的数组证明
docker-compose启动redis集群
Jmeter 5.5版本发布说明