mirror of
https://github.com/krahets/hello-algo.git
synced 2026-04-02 10:13:00 +08:00
Bug fixes and improvements (#1078)
* Fix the logo in the en version * Optimize header color and fix body background color * Update theme switch's name * Fix backfrop-filter on Safari * Update some animation's file name for adding egde when cropping * Re-count the comments number * A bug fix in n_queens_problem.md
This commit is contained in:
@@ -321,13 +321,13 @@
|
||||
如下图所示,我们可以将链表的“头节点”和“尾节点”分别视为“队首”和“队尾”,规定队尾仅可添加节点,队首仅可删除节点。
|
||||
|
||||
=== "LinkedListQueue"
|
||||

|
||||

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

|
||||

|
||||
|
||||
=== "pop()"
|
||||

|
||||

|
||||
|
||||
以下是用链表实现队列的代码:
|
||||
|
||||
@@ -349,13 +349,13 @@
|
||||
可以看到,入队和出队操作都只需进行一次操作,时间复杂度均为 $O(1)$ 。
|
||||
|
||||
=== "ArrayQueue"
|
||||

|
||||

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

|
||||

|
||||
|
||||
=== "pop()"
|
||||

|
||||

|
||||
|
||||
你可能会发现一个问题:在不断进行入队和出队的过程中,`front` 和 `rear` 都在向右移动,**当它们到达数组尾部时就无法继续移动了**。为了解决此问题,我们可以将数组视为首尾相接的“环形数组”。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user