2024-01-09 16:00:24 +08:00
|
|
|
---
|
|
|
|
comments: true
|
|
|
|
icon: material/stack-overflow
|
|
|
|
---
|
|
|
|
|
2024-04-06 03:02:20 +08:00
|
|
|
# Chapter 5. Stack and queue
|
2024-01-09 04:42:00 +08:00
|
|
|
|
2024-04-06 03:02:20 +08:00
|
|
|
![Stack and queue](../assets/covers/chapter_stack_and_queue.jpg){ class="cover-image" }
|
2024-01-09 04:42:00 +08:00
|
|
|
|
|
|
|
!!! abstract
|
|
|
|
|
2024-01-28 22:31:08 +08:00
|
|
|
A stack is like cats placed on top of each other, while a queue is like cats lined up one by one.
|
2024-01-09 04:42:00 +08:00
|
|
|
|
2024-01-28 22:31:08 +08:00
|
|
|
They represent the logical relationships of Last-In-First-Out (LIFO) and First-In-First-Out (FIFO), respectively.
|
2024-01-09 16:00:24 +08:00
|
|
|
|
|
|
|
## Chapter Contents
|
|
|
|
|
|
|
|
- [5.1 Stack](https://www.hello-algo.com/en/chapter_stack_and_queue/stack/)
|
|
|
|
- [5.2 Queue](https://www.hello-algo.com/en/chapter_stack_and_queue/queue/)
|
2024-04-06 03:02:20 +08:00
|
|
|
- [5.3 Double-ended queue](https://www.hello-algo.com/en/chapter_stack_and_queue/deque/)
|
2024-01-09 16:00:24 +08:00
|
|
|
- [5.4 Summary](https://www.hello-algo.com/en/chapter_stack_and_queue/summary/)
|