当前位置:网站首页>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 !
边栏推荐
- Detailed explanation of serialization and deserialization
- 简易博客系统
- No qualifying bean of type ‘......‘ available
- Oracle ORA error message
- Conditionally [jsonignore]
- How do we make money in agriculture, rural areas and farmers? 100% for reference
- Cf464e the classic problem [shortest path, chairman tree]
- WPF效果第一百九十一篇之框选ListBox
- Take you to wechat applet development in 3 minutes
- A brief introduction to symbols and link libraries in C language
猜你喜欢
Pytoch foundation - (1) initialization of tensors
[Massey] Massey font format and typesetting requirements
2. GPIO related operations
Blue style mall website footer code
How to modify field constraints (type, default, null, etc.) in a table
Proof of Stirling formula
math_ Derivative function derivation of limit & differential & derivative & derivative / logarithmic function (derivative definition limit method) / derivative formula derivation of exponential functi
MySql数据库root账户无法远程登陆解决办法
Database, relational database and NoSQL non relational database
[PSO] Based on PSO particle swarm optimization, matlab simulation of the calculation of the lowest transportation cost of goods at material points, including transportation costs, agent conversion cos
随机推荐
在 .NET 6 中使用 Startup.cs 更简洁的方法
Conditionally [jsonignore]
【PSO】基于PSO粒子群优化的物料点货物运输成本最低值计算matlab仿真,包括运输费用、代理人转换费用、运输方式转化费用和时间惩罚费用
Crawler of explanation and application of agency theory
Ipv4中的A 、B、C类网络及子网掩码
如何修改表中的字段约束条件(类型,default, null等)
Factors affecting user perception
Basic concepts of LTE user experience
SSTI template injection explanation and real problem practice
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
Multi project programming minimalist use case
2.1 rtthread pin device details
【按键消抖】基于FPGA的按键消抖模块开发
潘多拉 IOT 开发板学习(HAL 库)—— 实验9 PWM输出实验(学习笔记)
Maxay paper latex template description
[FPGA tutorial case 12] design and implementation of complex multiplier based on vivado core
Remote Sensing Image Super-resolution and Object Detection: Benchmark and State of the Art
UDP reliable transport protocol (quic)
mysql关于自增长增长问题
Record the pit of NETCORE's memory surge