From b5c65756fcb021f59360d8a270738e532df5965c Mon Sep 17 00:00:00 2001 From: krahets Date: Fri, 31 May 2024 17:45:16 +0800 Subject: [PATCH] build --- docs/chapter_stack_and_queue/deque.md | 6 ++++++ docs/chapter_stack_and_queue/queue.md | 4 ++++ en/docs/index.html | 7 +++++++ zh-Hant/docs/index.html | 15 +++++++++++++++ 4 files changed, 32 insertions(+) diff --git a/docs/chapter_stack_and_queue/deque.md b/docs/chapter_stack_and_queue/deque.md index 60cd0256b..1d5f148f6 100644 --- a/docs/chapter_stack_and_queue/deque.md +++ b/docs/chapter_stack_and_queue/deque.md @@ -2830,6 +2830,9 @@ comments: true /* 队首出队 */ func (q *arrayDeque) popFirst() any { num := q.peekFirst() + if num == nil { + return nil + } // 队首指针向后移动一位 q.front = q.index(q.front + 1) q.queSize-- @@ -2839,6 +2842,9 @@ comments: true /* 队尾出队 */ func (q *arrayDeque) popLast() any { num := q.peekLast() + if num == nil { + return nil + } q.queSize-- return num } diff --git a/docs/chapter_stack_and_queue/queue.md b/docs/chapter_stack_and_queue/queue.md index f606c322d..bed7488a6 100755 --- a/docs/chapter_stack_and_queue/queue.md +++ b/docs/chapter_stack_and_queue/queue.md @@ -1762,6 +1762,10 @@ comments: true /* 出队 */ func (q *arrayQueue) pop() any { num := q.peek() + if num == nil { + return nil + } + // 队首指针向后移动一位,若越过尾部,则返回到数组头部 q.front = (q.front + 1) % q.queCapacity q.queSize-- diff --git a/en/docs/index.html b/en/docs/index.html index 9e72ce177..85ac7bdb0 100644 --- a/en/docs/index.html +++ b/en/docs/index.html @@ -322,6 +322,13 @@
JS, TS +
+ + Reviewer: khoaxuantu +
khoaxuantu +
Ruby +
+
Reviewer: krahets diff --git a/zh-Hant/docs/index.html b/zh-Hant/docs/index.html index e28b7eb86..de1acac46 100644 --- a/zh-Hant/docs/index.html +++ b/zh-Hant/docs/index.html @@ -286,6 +286,14 @@
Zig, Rust
+
+ + Reviewer: curtishd +
curtishd +
Kotlin +
+
Reviewer: Gonglja @@ -314,6 +322,13 @@
JS, TS
+
+ + Reviewer: khoaxuantu +
khoaxuantu +
Ruby +
+
Reviewer: krahets