mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-25 19:22:27 +08:00
build
This commit is contained in:
@ -8,7 +8,7 @@ comments: true
|
||||
|
||||
如图 5-4 所示,我们将队列的头部称为“队首”,尾部称为“队尾”,将把元素加入队尾的操作称为“入队”,删除队首元素的操作称为“出队”。
|
||||
|
||||

|
||||
{ class="animation-figure" }
|
||||
|
||||
<p align="center"> 图 5-4 队列的先入先出规则 </p>
|
||||
|
||||
@ -325,13 +325,13 @@ comments: true
|
||||
如图 5-5 所示,我们可以将链表的“头节点”和“尾节点”分别视为“队首”和“队尾”,规定队尾仅可添加节点,队首仅可删除节点。
|
||||
|
||||
=== "LinkedListQueue"
|
||||

|
||||
{ class="animation-figure" }
|
||||
|
||||
=== "push()"
|
||||

|
||||
{ class="animation-figure" }
|
||||
|
||||
=== "pop()"
|
||||

|
||||
{ class="animation-figure" }
|
||||
|
||||
<p align="center"> 图 5-5 基于链表实现队列的入队出队操作 </p>
|
||||
|
||||
@ -1216,13 +1216,13 @@ comments: true
|
||||
可以看到,入队和出队操作都只需进行一次操作,时间复杂度均为 $O(1)$ 。
|
||||
|
||||
=== "ArrayQueue"
|
||||

|
||||
{ class="animation-figure" }
|
||||
|
||||
=== "push()"
|
||||

|
||||
{ class="animation-figure" }
|
||||
|
||||
=== "pop()"
|
||||

|
||||
{ class="animation-figure" }
|
||||
|
||||
<p align="center"> 图 5-6 基于数组实现队列的入队出队操作 </p>
|
||||
|
||||
|
Reference in New Issue
Block a user