mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-23 09:42:28 +08:00
build
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@ -1,8 +1,13 @@
|
||||
# Stack and Queue
|
||||
---
|
||||
comments: true
|
||||
icon: material/stack-overflow
|
||||
---
|
||||
|
||||
# Chapter 5. Stack and Queue
|
||||
|
||||
<div class="center-table" markdown>
|
||||
|
||||

|
||||
{ class="cover-image" }
|
||||
|
||||
</div>
|
||||
|
||||
@ -11,3 +16,10 @@
|
||||
Stacks are like stacking cats, while queues are like cats lining up.
|
||||
|
||||
They respectively represent the logical relationships of Last-In-First-Out (LIFO) and First-In-First-Out (FIFO).
|
||||
|
||||
## 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/)
|
||||
- [5.3 Double-ended Queue](https://www.hello-algo.com/en/chapter_stack_and_queue/deque/)
|
||||
- [5.4 Summary](https://www.hello-algo.com/en/chapter_stack_and_queue/summary/)
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,10 @@
|
||||
# Summary
|
||||
---
|
||||
comments: true
|
||||
---
|
||||
|
||||
### Key Review
|
||||
# 5.4 Summary
|
||||
|
||||
### 1. Key Review
|
||||
|
||||
- A stack is a data structure that follows the Last-In-First-Out (LIFO) principle and can be implemented using either arrays or linked lists.
|
||||
- In terms of time efficiency, the array implementation of a stack has higher average efficiency, but during expansion, the time complexity for a single push operation can degrade to $O(n)$. In contrast, the linked list implementation of a stack offers more stable efficiency.
|
||||
@ -8,7 +12,7 @@
|
||||
- A queue is a data structure that follows the First-In-First-Out (FIFO) principle, and it can also be implemented using either arrays or linked lists. The conclusions regarding time and space efficiency for queues are similar to those for stacks.
|
||||
- A double-ended queue is a more flexible type of queue that allows adding and removing elements from both ends.
|
||||
|
||||
### Q & A
|
||||
### 2. Q & A
|
||||
|
||||
**Q**: Is the browser's forward and backward functionality implemented with a doubly linked list?
|
||||
|
||||
|
Reference in New Issue
Block a user