|
|
@ -325,19 +325,25 @@
|
|
|
|
=== "C++"
|
|
|
|
=== "C++"
|
|
|
|
|
|
|
|
|
|
|
|
```cpp title="linkedlist_deque.cpp"
|
|
|
|
```cpp title="linkedlist_deque.cpp"
|
|
|
|
|
|
|
|
[class]{ListNode}-[func]{}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[class]{LinkedListDeque}-[func]{}
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
=== "Python"
|
|
|
|
=== "Python"
|
|
|
|
|
|
|
|
|
|
|
|
```python title="linkedlist_deque.py"
|
|
|
|
```python title="linkedlist_deque.py"
|
|
|
|
|
|
|
|
[class]{ListNode}-[func]{}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[class]{LinkedListDeque}-[func]{}
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
=== "Go"
|
|
|
|
=== "Go"
|
|
|
|
|
|
|
|
|
|
|
|
```go title="linkedlist_deque.go"
|
|
|
|
```go title="linkedlist_deque.go"
|
|
|
|
|
|
|
|
[class]{ListNode}-[func]{}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[class]{LinkedListDeque}-[func]{}
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
=== "JavaScript"
|
|
|
|
=== "JavaScript"
|
|
|
@ -359,7 +365,9 @@
|
|
|
|
=== "C"
|
|
|
|
=== "C"
|
|
|
|
|
|
|
|
|
|
|
|
```c title="linkedlist_deque.c"
|
|
|
|
```c title="linkedlist_deque.c"
|
|
|
|
|
|
|
|
[class]{ListNode}-[func]{}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[class]{LinkedListDeque}-[func]{}
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
=== "C#"
|
|
|
|
=== "C#"
|
|
|
@ -381,7 +389,9 @@
|
|
|
|
=== "Zig"
|
|
|
|
=== "Zig"
|
|
|
|
|
|
|
|
|
|
|
|
```zig title="linkedlist_deque.zig"
|
|
|
|
```zig title="linkedlist_deque.zig"
|
|
|
|
|
|
|
|
[class]{ListNode}-[func]{}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[class]{LinkedListDeque}-[func]{}
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### 基于数组的实现
|
|
|
|
### 基于数组的实现
|
|
|
@ -414,43 +424,43 @@
|
|
|
|
=== "C++"
|
|
|
|
=== "C++"
|
|
|
|
|
|
|
|
|
|
|
|
```cpp title="array_deque.cpp"
|
|
|
|
```cpp title="array_deque.cpp"
|
|
|
|
|
|
|
|
[class]{ArrayDeque}-[func]{}
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
=== "Python"
|
|
|
|
=== "Python"
|
|
|
|
|
|
|
|
|
|
|
|
```python title="array_deque.py"
|
|
|
|
```python title="array_deque.py"
|
|
|
|
|
|
|
|
[class]{ArrayDeque}-[func]{}
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
=== "Go"
|
|
|
|
=== "Go"
|
|
|
|
|
|
|
|
|
|
|
|
```go title="array_deque.go"
|
|
|
|
```go title="array_deque.go"
|
|
|
|
|
|
|
|
[class]{ArrayDeque}-[func]{}
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
=== "JavaScript"
|
|
|
|
=== "JavaScript"
|
|
|
|
|
|
|
|
|
|
|
|
```js title="array_deque.js"
|
|
|
|
```js title="array_deque.js"
|
|
|
|
|
|
|
|
[class]{ArrayDeque}-[func]{}
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
=== "TypeScript"
|
|
|
|
=== "TypeScript"
|
|
|
|
|
|
|
|
|
|
|
|
```typescript title="array_deque.ts"
|
|
|
|
```typescript title="array_deque.ts"
|
|
|
|
|
|
|
|
[class]{ArrayDeque}-[func]{}
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
=== "C"
|
|
|
|
=== "C"
|
|
|
|
|
|
|
|
|
|
|
|
```c title="array_deque.c"
|
|
|
|
```c title="array_deque.c"
|
|
|
|
|
|
|
|
[class]{ArrayDeque}-[func]{}
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
=== "C#"
|
|
|
|
=== "C#"
|
|
|
|
|
|
|
|
|
|
|
|
```csharp title="array_deque.cs"
|
|
|
|
```csharp title="array_deque.cs"
|
|
|
|
|
|
|
|
[class]{ArrayDeque}-[func]{}
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
=== "Swift"
|
|
|
|
=== "Swift"
|
|
|
@ -462,5 +472,5 @@
|
|
|
|
=== "Zig"
|
|
|
|
=== "Zig"
|
|
|
|
|
|
|
|
|
|
|
|
```zig title="array_deque.zig"
|
|
|
|
```zig title="array_deque.zig"
|
|
|
|
|
|
|
|
[class]{ArrayDeque}-[func]{}
|
|
|
|
```
|
|
|
|
```
|
|
|
|