This commit is contained in:
krahets
2024-03-31 03:53:04 +08:00
parent 87af663929
commit c23e576da4
68 changed files with 2139 additions and 22 deletions
+15 -1
View File
@@ -1968,6 +1968,14 @@ The implementation code is as follows:
}
```
=== "Ruby"
```ruby title="linkedlist_deque.rb"
[class]{ListNode}-[func]{}
[class]{LinkedListDeque}-[func]{}
```
=== "Zig"
```zig title="linkedlist_deque.zig"
@@ -2634,7 +2642,7 @@ The implementation only needs to add methods for "front enqueue" and "rear deque
}
// 计算队尾指针,指向队尾索引 + 1
rear := q.index(q.front + q.queSize)
// 将 num 添加至队
// 将 num 添加至队
q.nums[rear] = num
q.queSize++
}
@@ -3450,6 +3458,12 @@ The implementation only needs to add methods for "front enqueue" and "rear deque
}
```
=== "Ruby"
```ruby title="array_deque.rb"
[class]{ArrayDeque}-[func]{}
```
=== "Zig"
```zig title="array_deque.zig"