mirror of
https://github.com/krahets/hello-algo.git
synced 2026-02-03 02:43:41 +08:00
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:
@@ -10,14 +10,14 @@
|
||||
|
||||
<p align="center"> 表 <id> 双向队列操作效率 </p>
|
||||
|
||||
| 方法名 | 描述 | 时间复杂度 |
|
||||
| ----------- | ---------------- | ---------- |
|
||||
| pushFirst() | 将元素添加至队首 | $O(1)$ |
|
||||
| pushLast() | 将元素添加至队尾 | $O(1)$ |
|
||||
| popFirst() | 删除队首元素 | $O(1)$ |
|
||||
| popLast() | 删除队尾元素 | $O(1)$ |
|
||||
| peekFirst() | 访问队首元素 | $O(1)$ |
|
||||
| peekLast() | 访问队尾元素 | $O(1)$ |
|
||||
| 方法名 | 描述 | 时间复杂度 |
|
||||
| ------------- | ---------------- | ---------- |
|
||||
| `pushFirst()` | 将元素添加至队首 | $O(1)$ |
|
||||
| `pushLast()` | 将元素添加至队尾 | $O(1)$ |
|
||||
| `popFirst()` | 删除队首元素 | $O(1)$ |
|
||||
| `popLast()` | 删除队尾元素 | $O(1)$ |
|
||||
| `peekFirst()` | 访问队首元素 | $O(1)$ |
|
||||
| `peekLast()` | 访问队尾元素 | $O(1)$ |
|
||||
|
||||
同样地,我们可以直接使用编程语言中已实现的双向队列类:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user