Update the chapter of stack and queue.

This commit is contained in:
krahets
2023-03-12 04:14:36 +08:00
parent 050b922f8a
commit 82bbdd444d
5 changed files with 27 additions and 35 deletions

View File

@ -8,7 +8,7 @@
## 队列常用操作
队列的常用操作见下表,方法名需根据特定语言来确定。
队列的常用操作见下表,方法名需根据语言来确定,此处以 Java 为例
<div class="center-table" markdown>
@ -16,9 +16,7 @@
| --------- | -------------------------- | -------- |
| push() | 元素入队,即将元素添加至队尾 | $O(1)$ |
| poll() | 队首元素出队 | $O(1)$ |
| front() | 访问队首元素 | $O(1)$ |
| size() | 获取队列的长度 | $O(1)$ |
| isEmpty() | 判断队列是否为空 | $O(1)$ |
| peek() | 访问队首元素 | $O(1)$ |
</div>