mirror of
https://github.com/krahets/hello-algo.git
synced 2026-06-16 07:08:21 +08:00
Add animation player (#1877)
* Add auto slide controller. * Fix the animation blocks. * renamed as animation_player * Bug fixes * Refine animation player controls
This commit is contained in:
@@ -399,19 +399,19 @@
|
||||
|
||||
如下图所示,我们将双向链表的头节点和尾节点视为双向队列的队首和队尾,同时实现在两端添加和删除节点的功能。
|
||||
|
||||
=== "LinkedListDeque"
|
||||
=== "<1>"
|
||||

|
||||
|
||||
=== "push_last()"
|
||||
=== "<2>"
|
||||

|
||||
|
||||
=== "push_first()"
|
||||
=== "<3>"
|
||||

|
||||
|
||||
=== "pop_last()"
|
||||
=== "<4>"
|
||||

|
||||
|
||||
=== "pop_first()"
|
||||
=== "<5>"
|
||||

|
||||
|
||||
实现代码如下所示:
|
||||
@@ -424,19 +424,19 @@
|
||||
|
||||
如下图所示,与基于数组实现队列类似,我们也可以使用环形数组来实现双向队列。
|
||||
|
||||
=== "ArrayDeque"
|
||||
=== "<1>"
|
||||

|
||||
|
||||
=== "push_last()"
|
||||
=== "<2>"
|
||||

|
||||
|
||||
=== "push_first()"
|
||||
=== "<3>"
|
||||

|
||||
|
||||
=== "pop_last()"
|
||||
=== "<4>"
|
||||

|
||||
|
||||
=== "pop_first()"
|
||||
=== "<5>"
|
||||

|
||||
|
||||
在队列的实现基础上,仅需增加“队首入队”和“队尾出队”的方法:
|
||||
|
||||
Reference in New Issue
Block a user