mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-25 11:13:38 +08:00
build
This commit is contained in:
@ -358,19 +358,19 @@ For a double-ended queue, both the head and the tail can perform enqueue and deq
|
||||
As shown in the Figure 5-8 , we treat the head and tail nodes of the doubly linked list as the front and rear of the double-ended queue, respectively, and implement the functionality to add and remove nodes at both ends.
|
||||
|
||||
=== "LinkedListDeque"
|
||||
{ class="animation-figure" }
|
||||
{ class="animation-figure" }
|
||||
|
||||
=== "pushLast()"
|
||||
{ class="animation-figure" }
|
||||
{ class="animation-figure" }
|
||||
|
||||
=== "pushFirst()"
|
||||
{ class="animation-figure" }
|
||||
{ class="animation-figure" }
|
||||
|
||||
=== "popLast()"
|
||||
{ class="animation-figure" }
|
||||
{ class="animation-figure" }
|
||||
|
||||
=== "popFirst()"
|
||||
{ class="animation-figure" }
|
||||
{ class="animation-figure" }
|
||||
|
||||
<p align="center"> Figure 5-8 Implementing Double-Ended Queue with Doubly Linked List for Enqueue and Dequeue Operations </p>
|
||||
|
||||
@ -1996,19 +1996,19 @@ The implementation code is as follows:
|
||||
As shown in the Figure 5-9 , similar to implementing a queue with an array, we can also use a circular array to implement a double-ended queue.
|
||||
|
||||
=== "ArrayDeque"
|
||||
{ class="animation-figure" }
|
||||
{ class="animation-figure" }
|
||||
|
||||
=== "pushLast()"
|
||||
{ class="animation-figure" }
|
||||
{ class="animation-figure" }
|
||||
|
||||
=== "pushFirst()"
|
||||
{ class="animation-figure" }
|
||||
{ class="animation-figure" }
|
||||
|
||||
=== "popLast()"
|
||||
{ class="animation-figure" }
|
||||
{ class="animation-figure" }
|
||||
|
||||
=== "popFirst()"
|
||||
{ class="animation-figure" }
|
||||
{ class="animation-figure" }
|
||||
|
||||
<p align="center"> Figure 5-9 Implementing Double-Ended Queue with Array for Enqueue and Dequeue Operations </p>
|
||||
|
||||
|
Reference in New Issue
Block a user