当前位置:网站首页>Stack and queue
Stack and queue
2022-07-06 03:57:00 【Pupu pupu】
Author: intellectuals
Computer science
Controllable things Heavy and calm Uncontrollable things Optimistic face
[email protected]
️
️ ️ ️
————————————————
Copyright notice : This paper is about CSDN Blogger 「 Pu Shangqing sky 」 The original article of
List of articles
Knowledge point
Stack and queue Are a special linear structure , Just for Insert / Delete The way of elements is limited
- Stack : First in, then out (push/pop/peek The time complexity of O(1))
- queue : fifo (add/remove/element The time complexity of O(1))

queue
- queue : Advanced display (FIFO)
- There are two interfaces :
1.Queue: queue
2.Deque: The bidirectional queue
Queue Common methods of queue
add: Specify that the element is inserted into the queue
element: Retrieve but not delete , The head of its queue
remove: Retrieve and delete , The head of this queue
peek: Retrieve but not delete , The head of the queue
poll: Retrieve and delete , The head of this queue
Deque The bidirectional queue

Stack
- Stack : First in, then out
Common methods
Stack class :Stack
Method :
empty: Judge whether the stack is empty
push: Add elements at the top of the stack
peek: Look at the top of the stack elements , But don't delete
pop: Delete stack top element , And return the element
Praise first and then watch , Develop habits !!!^ _ ^
Update your knowledge every day !!!
It's not easy to code words , Everyone's support is my driving force to stick to it . Don't forget after you like Focus on I oh !
边栏推荐
- [optimization model] Monte Carlo method of optimization calculation
- The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
- C language -- structs, unions, enumerations, and custom types
- 2. GPIO related operations
- Proof of Stirling formula
- C language circular statement
- [practice] mathematics in lottery
- 【按鍵消抖】基於FPGA的按鍵消抖模塊開發
- DM8 archive log file manual switching
- A brief introduction to symbols and link libraries in C language
猜你喜欢
![Cf464e the classic problem [shortest path, chairman tree]](/img/6b/65b2dc62422a45cc72f287c38dbc58.jpg)
Cf464e the classic problem [shortest path, chairman tree]

C#(三十一)之自定义事件

WPF effect Article 191 box selection listbox

User experience index system

【按键消抖】基于FPGA的按键消抖模块开发

Redis (replicate dictionary server) cache

《2022年中国银行业RPA供应商实力矩阵分析》研究报告正式启动

ESP32(基于Arduino)连接EMQX的Mqtt服务器上传信息与命令控制

如何修改表中的字段约束条件(类型,default, null等)

C language -- structs, unions, enumerations, and custom types
随机推荐
mysql从一个连续时间段的表中读取缺少数据
Overview of super-resolution reconstruction of remote sensing images
Blue Bridge Cup - Castle formula
[Massey] Massey font format and typesetting requirements
C form application of C (27)
C#(二十七)之C#窗体应用
Use js to complete an LRU cache
Viewing and verifying backup sets using dmrman
Basic concepts of LTE user experience
cookie,session,Token 这些你都知道吗?
mysql关于自增长增长问题
Record the pit of NETCORE's memory surge
An article will give you a comprehensive understanding of the internal and external components of "computer"
Blue style mall website footer code
Image super resolution using deep revolutionary networks (srcnn) interpretation and Implementation
51nod 1130 n factorial length V2 (Stirling approximation)
3.1 detailed explanation of rtthread serial port device (V1)
Benefits of automated testing
Data analysis Seaborn visualization (for personal use)
【PSO】基于PSO粒子群优化的物料点货物运输成本最低值计算matlab仿真,包括运输费用、代理人转换费用、运输方式转化费用和时间惩罚费用