当前位置:网站首页>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
边栏推荐
- Force deduction 62 different paths (the number of all paths from the upper left to the lower right of the matrix) (dynamic planning)
- 请问如何查一篇外文文献的DOI号?
- Prompt for channel security on the super-v / device defender side when installing vmmare
- 骑士战胜魔王(背包&dp)
- C语言整理(待更新)
- Abnova循环肿瘤DNA丨全血分离,基因组DNA萃取分析
- C interview 24 (pointer) define a double array with 20 elements a
- ICML 2022 | 探索语言模型的最佳架构和训练方法
- dolphinscheduler3.x本地启动
- HKUST & MsrA new research: on image to image conversion, fine tuning is all you need
猜你喜欢

Shared memory for interprocess communication

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

Software testing knowledge reserve: how much do you know about the basic knowledge of "login security"?

Common problems of caching in high concurrency scenarios

dolphinscheduler3.x本地启动
![[SOC FPGA] peripheral PIO button lights up](/img/34/58728bddbf91eb69e9c0062dbfd531.jpg)
[SOC FPGA] peripheral PIO button lights up

一段程序让你明白什么静态内部类,局部内部类,匿名内部类

uniapp开发小程序如何使用微信云托管或云函数进行云开发

PostgreSQL database timescaledb function time_ bucket_ Gapfill() error resolution and license replacement

Force deduction 62 different paths (the number of all paths from the upper left to the lower right of the matrix) (dynamic planning)
随机推荐
Linear algebra (1)
牛客小白月赛52 E.分组求对数和(二分&容斥)
精准时空行程流调系统—基于UWB超高精度定位系统
屏幕程序用串口无法调试情况
Unable to debug screen program with serial port
ICML 2022 | explore the best architecture and training method of language model
docker-compose启动redis集群
PostgreSQL database timescaledb function time_ bucket_ Gapfill() error resolution and license replacement
C language (structure) defines a user structure with the following fields:
C面试24. (指针)定义一个含有20个元素的double型数组a
UIC (configuration UI Engineering) public file library adds 7 industry materials
【解决】Final app status- UNDEFINED, exitCode- 16
安装VMmare时候提示hyper-v / device defender 侧通道安全性
一段程序让你明白什么静态内部类,局部内部类,匿名内部类
MySQL的安装
Crudini profile editing tool
360 Zhiyu released 7.0 new products to create an exclusive "unified digital workspace" for the party, government and army, and central and state-owned enterprises
怎样查找某个外文期刊的文献?
693. Travel sequencing
[SOC FPGA] peripheral PIO button lights up