当前位置:网站首页>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 !
边栏推荐
- How to standardize the deployment of automated testing?
- Error 1045 (28000): access denied for user 'root' @ 'localhost' (using password: no/yes
- Développement d'un module d'élimination des bavardages à clé basé sur la FPGA
- 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
- C#(二十八)之C#鼠标事件、键盘事件
- 1. New project
- UDP reliable transport protocol (quic)
- Plus d'un milliard d'utilisateurs de grandes entreprises comme Facebook ont été compromis, il est temps de se concentrer sur le did
- Take you to wechat applet development in 3 minutes
- 关于非虚函数的假派生
猜你喜欢

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

C#(二十八)之C#鼠标事件、键盘事件

3.1 detailed explanation of rtthread serial port device (V1)

Record the pit of NETCORE's memory surge
![[001] [stm32] how to download STM32 original factory data](/img/5a/02d87fe1409a9427180ecefb8326c6.jpg)
[001] [stm32] how to download STM32 original factory data

Simple blog system

Align items and align content in flex layout

Développement d'un module d'élimination des bavardages à clé basé sur la FPGA

RT thread -- FTP of LwIP (2)

TCP/IP协议里面的网关地址和ip地址有什么区别?
随机推荐
Overview of super-resolution reconstruction of remote sensing images
A brief introduction to symbols and link libraries in C language
自动化测试的好处
Use js to complete an LRU cache
math_极限&微分&导数&微商/对数函数的导函数推导(导数定义极限法)/指数函数求导公式推导(反函数求导法则/对数求导法)
User perceived monitoring experience
Pandora IOT development board learning (HAL Library) - Experiment 9 PWM output experiment (learning notes)
[adjustable delay network] development of FPGA based adjustable delay network system Verilog
Why do you want to start pointer compression?
Detailed explanation of serialization and deserialization
ESP32_ FreeRTOS_ Arduino_ 1_ Create task
Microkernel structure understanding
2.13 weekly report
Pytoch foundation - (1) initialization of tensors
3分钟带你了解微信小程序开发
WPF效果第一百九十一篇之框选ListBox
mysql从一个连续时间段的表中读取缺少数据
asp. Core is compatible with both JWT authentication and cookies authentication
Stc8h development (XII): I2C drive AT24C08, at24c32 series EEPROM storage
Facebook and other large companies have leaked more than one billion user data, and it is time to pay attention to did