mirror of
https://github.com/krahets/hello-algo.git
synced 2026-04-03 10:40:15 +08:00
build
This commit is contained in:
@@ -12,8 +12,6 @@ comments: true
|
||||
|
||||
双向队列的常用操作见下表,方法名需根据特定语言来确定。
|
||||
|
||||
<p align="center"> Table. 双向队列的常用操作 </p>
|
||||
|
||||
<div class="center-table" markdown>
|
||||
|
||||
| 方法名 | 描述 | 时间复杂度 |
|
||||
@@ -304,7 +302,7 @@ comments: true
|
||||
我们将双向链表的头结点和尾结点分别看作双向队列的队首和队尾,并且实现在两端都能添加与删除结点。
|
||||
|
||||
=== "LinkedListDeque"
|
||||

|
||||

|
||||
|
||||
=== "pushLast()"
|
||||

|
||||
@@ -880,7 +878,7 @@ comments: true
|
||||
与基于数组实现队列类似,我们也可以使用环形数组来实现双向队列。在实现队列的基础上,增加实现“队首入队”和“队尾出队”方法即可。
|
||||
|
||||
=== "ArrayDeque"
|
||||

|
||||

|
||||
|
||||
=== "pushLast()"
|
||||

|
||||
|
||||
@@ -14,8 +14,6 @@ comments: true
|
||||
|
||||
队列的常用操作见下表,方法名需根据特定语言来确定。
|
||||
|
||||
<p align="center"> Table. 队列的常用操作 </p>
|
||||
|
||||
<div class="center-table" markdown>
|
||||
|
||||
| 方法名 | 描述 | 时间复杂度 |
|
||||
@@ -269,7 +267,7 @@ comments: true
|
||||
我们将链表的「头结点」和「尾结点」分别看作是队首和队尾,并规定队尾只可添加结点,队首只可删除结点。
|
||||
|
||||
=== "LinkedListQueue"
|
||||

|
||||

|
||||
|
||||
=== "push()"
|
||||

|
||||
@@ -940,7 +938,7 @@ comments: true
|
||||
观察发现,入队与出队操作都仅需单次操作即可完成,时间复杂度皆为 $O(1)$ 。
|
||||
|
||||
=== "ArrayQueue"
|
||||

|
||||

|
||||
|
||||
=== "push()"
|
||||

|
||||
|
||||
@@ -16,8 +16,6 @@ comments: true
|
||||
|
||||
栈的常用操作见下表(方法命名以 Java 为例)。
|
||||
|
||||
<p align="center"> Table. 栈的常用操作 </p>
|
||||
|
||||
<div class="center-table" markdown>
|
||||
|
||||
| 方法 | 描述 | 时间复杂度 |
|
||||
@@ -272,7 +270,7 @@ comments: true
|
||||
对于入栈操作,将元素插入到链表头部即可,这种结点添加方式被称为“头插法”。而对于出栈操作,则将头结点从链表中删除即可。
|
||||
|
||||
=== "LinkedListStack"
|
||||

|
||||

|
||||
|
||||
=== "push()"
|
||||

|
||||
@@ -849,7 +847,7 @@ comments: true
|
||||
使用「数组」实现栈时,考虑将数组的尾部当作栈顶。这样设计下,「入栈」与「出栈」操作就对应在数组尾部「添加元素」与「删除元素」,时间复杂度都为 $O(1)$ 。
|
||||
|
||||
=== "ArrayStack"
|
||||

|
||||

|
||||
|
||||
=== "push()"
|
||||

|
||||
|
||||
Reference in New Issue
Block a user