mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-25 03:08:54 +08:00
build
This commit is contained in:
@ -6,7 +6,7 @@ comments: true
|
||||
|
||||
在队列中,我们仅能在头部删除或在尾部添加元素。如图 5-7 所示,「双向队列 double-ended queue」提供了更高的灵活性,允许在头部和尾部执行元素的添加或删除操作。
|
||||
|
||||

|
||||
{ class="animation-figure" }
|
||||
|
||||
<p align="center"> 图 5-7 双向队列的操作 </p>
|
||||
|
||||
@ -365,19 +365,19 @@ comments: true
|
||||
如图 5-8 所示,我们将双向链表的头节点和尾节点视为双向队列的队首和队尾,同时实现在两端添加和删除节点的功能。
|
||||
|
||||
=== "LinkedListDeque"
|
||||

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

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

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

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

|
||||
{ class="animation-figure" }
|
||||
|
||||
<p align="center"> 图 5-8 基于链表实现双向队列的入队出队操作 </p>
|
||||
|
||||
@ -2008,19 +2008,19 @@ comments: true
|
||||
如图 5-9 所示,与基于数组实现队列类似,我们也可以使用环形数组来实现双向队列。
|
||||
|
||||
=== "ArrayDeque"
|
||||

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

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

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

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

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