Update the book based on the revised second edition (#1014)

* Revised the book

* Update the book with the second revised edition

* Revise base on the manuscript of the first edition
This commit is contained in:
Yudong Jin
2023-12-28 18:06:09 +08:00
committed by GitHub
parent 19dde675df
commit f68bbb0d59
261 changed files with 643 additions and 647 deletions

View File

@@ -12,11 +12,11 @@
<p align="center"> 表 <id> &nbsp; 队列操作效率 </p>
| 方法名 | 描述 | 时间复杂度 |
| ------ | ---------------------------- | ---------- |
| push() | 元素入队,即将元素添加至队尾 | $O(1)$ |
| pop() | 队首元素出队 | $O(1)$ |
| peek() | 访问队首元素 | $O(1)$ |
| 方法名 | 描述 | 时间复杂度 |
| -------- | ---------------------------- | ---------- |
| `push()` | 元素入队,即将元素添加至队尾 | $O(1)$ |
| `pop()` | 队首元素出队 | $O(1)$ |
| `peek()` | 访问队首元素 | $O(1)$ |
我们可以直接使用编程语言中现成的队列类:
@@ -310,7 +310,7 @@
## 队列实现
为了实现队列,我们需要一种数据结构,可以在一端添加元素,并在另一端删除元素链表和数组都符合要求。
为了实现队列,我们需要一种数据结构,可以在一端添加元素,并在另一端删除元素链表和数组都符合要求。
### 基于链表的实现