当前位置:网站首页>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 !
边栏推荐
- JVM的手术刀式剖析——一文带你窥探JVM的秘密
- Use js to complete an LRU cache
- 在 .NET 6 中使用 Startup.cs 更简洁的方法
- RT thread -- FTP of LwIP (2)
- AcWing 243. A simple integer problem 2 (tree array interval modification interval query)
- [Key shake elimination] development of key shake elimination module based on FPGA
- Stc8h development (XII): I2C drive AT24C08, at24c32 series EEPROM storage
- C mouse event and keyboard event of C (XXVIII)
- Facebook and other large companies have leaked more than one billion user data, and it is time to pay attention to did
- 如何修改表中的字段约束条件(类型,default, null等)
猜你喜欢

Serial port-rs232-rs485-ttl

mysql关于自增长增长问题

20、 EEPROM memory (AT24C02) (similar to AD)

Facebook等大廠超十億用戶數據遭泄露,早該關注DID了
![[optimization model] Monte Carlo method of optimization calculation](/img/e6/2865806ffbbfaa8cc07ebf625fcde6.jpg)
[optimization model] Monte Carlo method of optimization calculation

Maxay paper latex template description

math_ Derivative function derivation of limit & differential & derivative & derivative / logarithmic function (derivative definition limit method) / derivative formula derivation of exponential functi
![[introduction to Django] 11 web page associated MySQL single field table (add, modify, delete)](/img/8a/068faf3e8de642c9e3c4118e6084aa.jpg)
[introduction to Django] 11 web page associated MySQL single field table (add, modify, delete)

User experience index system

No qualifying bean of type ‘......‘ available
随机推荐
Detailed explanation of serialization and deserialization
Suggestions for new engineer team members
3.2 detailed explanation of rtthread serial port device (V2)
【可调延时网络】基于FPGA的可调延时网络系统verilog开发
[analysis of variance] single factor analysis and multi factor analysis
[Massey] Massey font format and typesetting requirements
[Qt5] QT QWidget immediately appears and disappears
math_ Derivative function derivation of limit & differential & derivative & derivative / logarithmic function (derivative definition limit method) / derivative formula derivation of exponential functi
Flask learning and project practice 8: introduction and use of cookies and sessions
[optimization model] Monte Carlo method of optimization calculation
Prime Protocol宣布在Moonbeam上的跨链互连应用程序
Proof of Stirling formula
C#(三十一)之自定义事件
记一次excel XXE漏洞
Esp32 (based on Arduino) connects the mqtt server of emqx to upload information and command control
1. New project
登录mysql输入密码时报错,ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO/YES
C#(二十九)之C#listBox checkedlistbox imagelist
Overview of super-resolution reconstruction of remote sensing images
BUAA计算器(表达式计算-表达式树实现)