mirror of
https://github.com/krahets/hello-algo.git
synced 2025-12-19 07:17:54 +08:00
docs: add comments of the complexity to queue and deque
This commit is contained in:
@@ -246,6 +246,7 @@ comments: true
|
||||
let peek = queue.first!
|
||||
|
||||
/* 元素出队 */
|
||||
// 使用 Array 模拟时 poll 的复杂度为 O(n)
|
||||
let pool = queue.removeFirst()
|
||||
|
||||
/* 获取队列的长度 */
|
||||
|
||||
Reference in New Issue
Block a user