当前位置:网站首页>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 !
边栏推荐
- Hashcode and equals
- Ybtoj coloring plan [tree chain dissection, segment tree, tarjan]
- On Data Mining
- [Qt5] QT QWidget immediately appears and disappears
- Mapping between QoE and KQI
- 如何修改表中的字段约束条件(类型,default, null等)
- JVM的手术刀式剖析——一文带你窥探JVM的秘密
- Custom event of C (31)
- An article will give you a comprehensive understanding of the internal and external components of "computer"
- How do we make money in agriculture, rural areas and farmers? 100% for reference
猜你喜欢

C language circular statement

After five years of testing in byte, I was ruthlessly dismissed in July, hoping to wake up my brother who was paddling

BUAA喜鹊筑巢

Cubemx transplantation punctual atom LCD display routine

Align items and align content in flex layout

记一次excel XXE漏洞
![[meisai] meisai thesis reference template](/img/14/b39e1db0b5b35702508068e028ee5a.jpg)
[meisai] meisai thesis reference template

Plus d'un milliard d'utilisateurs de grandes entreprises comme Facebook ont été compromis, il est temps de se concentrer sur le did

Overview of super-resolution reconstruction of remote sensing images

RT thread -- FTP of LwIP (2)
随机推荐
[FPGA tutorial case 12] design and implementation of complex multiplier based on vivado core
Prime Protocol宣布在Moonbeam上的跨链互连应用程序
MySQL master-slave replication
[001] [stm32] how to download STM32 original factory data
Suggestions for new engineer team members
Prime protocol announces cross chain interconnection applications on moonbeam
Schnuka: what is visual positioning system and how to position it
20、 EEPROM memory (AT24C02) (similar to AD)
Align items and align content in flex layout
MySql数据库root账户无法远程登陆解决办法
C#(二十九)之C#listBox checkedlistbox imagelist
C form application of C (27)
C language -- structs, unions, enumerations, and custom types
UDP reliable transport protocol (quic)
【PSO】基于PSO粒子群优化的物料点货物运输成本最低值计算matlab仿真,包括运输费用、代理人转换费用、运输方式转化费用和时间惩罚费用
Scalpel like analysis of JVM -- this article takes you to peek into the secrets of JVM
Schnuka: visual positioning system working principle of visual positioning system
[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
【按鍵消抖】基於FPGA的按鍵消抖模塊開發
Overview of super-resolution reconstruction of remote sensing images