当前位置:网站首页>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 !
边栏推荐
- C form application of C (27)
- An article will give you a comprehensive understanding of the internal and external components of "computer"
- 【PSO】基于PSO粒子群优化的物料点货物运输成本最低值计算matlab仿真,包括运输费用、代理人转换费用、运输方式转化费用和时间惩罚费用
- 登录mysql输入密码时报错,ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO/YES
- Flask learning and project practice 9: WTF form verification
- 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
- Schnuka: what is visual positioning system and how to position it
- C#(二十七)之C#窗体应用
- math_ Derivative function derivation of limit & differential & derivative & derivative / logarithmic function (derivative definition limit method) / derivative formula derivation of exponential functi
- Esp32 (based on Arduino) connects the mqtt server of emqx to upload information and command control
猜你喜欢
Record the pit of NETCORE's memory surge
Network security - Security Service Engineer - detailed summary of skill manual (it is recommended to learn and collect)
Recommended papers on remote sensing image super-resolution
LTE CSFB test analysis
2.1 rtthread pin device details
Exchange bottles (graph theory + thinking)
[introduction to Django] 11 web page associated MySQL single field table (add, modify, delete)
P7735-[noi2021] heavy and heavy edges [tree chain dissection, line segment tree]
Suggestions for new engineer team members
How do we make money in agriculture, rural areas and farmers? 100% for reference
随机推荐
Facebook等大廠超十億用戶數據遭泄露,早該關注DID了
WPF效果第一百九十一篇之框选ListBox
Ethernet port &arm & MOS &push-pull open drain &up and down &high and low sides &time domain and frequency domain Fourier
Microkernel structure understanding
BUAA calculator (expression calculation - expression tree implementation)
Mathematical modeling regression analysis relationship between variables
/usr/bin/gzip: 1: ELF: not found/usr/bin/gzip: 3: : not found/usr/bin/gzip: 4: Syntax error:
Hashcode and equals
C#(二十七)之C#窗体应用
1. New project
【可调延时网络】基于FPGA的可调延时网络系统verilog开发
[FPGA tutorial case 12] design and implementation of complex multiplier based on vivado core
BUAA magpie nesting
在 .NET 6 中使用 Startup.cs 更简洁的方法
STC8H开发(十二): I2C驱动AT24C08,AT24C32系列EEPROM存储
[introduction to Django] 11 web page associated MySQL single field table (add, modify, delete)
KS003基于JSP和Servlet实现的商城系统
ESP32(基于Arduino)连接EMQX的Mqtt服务器上传信息与命令控制
Failure causes and optimization methods of LTE CSFB
C#(三十)之C#comboBox ListView treeView