当前位置:网站首页>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 !
边栏推荐
- The Research Report "2022 RPA supplier strength matrix analysis of China's banking industry" was officially launched
- Basic concepts of LTE user experience
- 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
- Security xxE vulnerability recurrence (XXe Lab)
- TCP/IP协议里面的网关地址和ip地址有什么区别?
- Cf464e the classic problem [shortest path, chairman tree]
- C#(三十一)之自定义事件
- Alibaba testers use UI automated testing to achieve element positioning
- RT thread -- FTP of LwIP (2)
- SSTI template injection explanation and real problem practice
猜你喜欢
C#(三十)之C#comboBox ListView treeView
Simple blog system
DM8 backup set deletion
[optimization model] Monte Carlo method of optimization calculation
Pytoch foundation - (1) initialization of tensors
Cubemx transplantation punctual atom LCD display routine
Overview of super-resolution reconstruction of remote sensing images
Schnuka: visual positioning system working principle of visual positioning system
Ethernet port &arm & MOS &push-pull open drain &up and down &high and low sides &time domain and frequency domain Fourier
2.1 rtthread pin device details
随机推荐
【可调延时网络】基于FPGA的可调延时网络系统verilog开发
3.1 detailed explanation of rtthread serial port device (V1)
登录mysql输入密码时报错,ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO/YES
Redis (replicate dictionary server) cache
P7735-[noi2021] heavy and heavy edges [tree chain dissection, line segment tree]
【按鍵消抖】基於FPGA的按鍵消抖模塊開發
Codeforces Global Round 19
Why do you want to start pointer compression?
Differential GPS RTK thousand search
3.2 detailed explanation of rtthread serial port device (V2)
Cubemx transplantation punctual atom LCD display routine
Conditionally [jsonignore]
Python book learning notes - Chapter 09 section 01 create and use classes
Blue Bridge Cup - Castle formula
TCP/IP协议里面的网关地址和ip地址有什么区别?
JS Vanke banner rotation chart JS special effect
[practice] mathematics in lottery
Benefits of automated testing
[meisai] meisai thesis reference template
[optimization model] Monte Carlo method of optimization calculation