当前位置:网站首页>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 !
边栏推荐
- Codeforces Global Round 19
- Data analysis Seaborn visualization (for personal use)
- Cubemx transplantation punctual atom LCD display routine
- Recommended papers on remote sensing image super-resolution
- [FPGA tutorial case 11] design and implementation of divider based on vivado core
- [analysis of variance] single factor analysis and multi factor analysis
- Indicator system of KQI and KPI
- On Data Mining
- User experience index system
- 自动化测试怎么规范部署?
猜你喜欢

【FPGA教程案例11】基于vivado核的除法器设计与实现

【按鍵消抖】基於FPGA的按鍵消抖模塊開發

登录mysql输入密码时报错,ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO/YES

Flask learning and project practice 8: introduction and use of cookies and sessions

KS008基于SSM的新闻发布系统

自动化测试怎么规范部署?

BUAA calculator (expression calculation - expression tree implementation)

Alibaba testers use UI automated testing to achieve element positioning

C#(二十七)之C#窗体应用

DM8 backup set deletion
随机推荐
Factors affecting user perception
Développement d'un module d'élimination des bavardages à clé basé sur la FPGA
Exchange bottles (graph theory + thinking)
WPF effect Article 191 box selection listbox
Thread sleep, thread sleep application scenarios
Database, relational database and NoSQL non relational database
MySql数据库root账户无法远程登陆解决办法
【FPGA教程案例12】基于vivado核的复数乘法器设计与实现
2.2 STM32 GPIO operation
自动化测试怎么规范部署?
Flask learning and project practice 8: introduction and use of cookies and sessions
Alibaba testers use UI automated testing to achieve element positioning
Schnuka: 3D vision detection application industry machine vision 3D detection
C (thirty) C combobox listview TreeView
[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
LTE CSFB test analysis
Ks008 SSM based press release system
/usr/bin/gzip: 1: ELF: not found/usr/bin/gzip: 3: : not found/usr/bin/gzip: 4: Syntax error:
Crawler of explanation and application of agency theory
C mouse event and keyboard event of C (XXVIII)