fix: sync array, deque, and printing fixes across translations (#1973)

Synchronize the fixes from #1936, #1824, and #1961 across translated editions and normalize C# and Dart formatting. Move Java CI to Ubuntu 24.04 so its Java 11/17 checks can run.
This commit is contained in:
Yudong Jin
2026-10-11 00:58:16 +08:00
committed by GitHub
parent 4eba6da393
commit 620abe42f3
58 changed files with 624 additions and 457 deletions
@@ -67,13 +67,18 @@ class LinkedListDeque {
return null;
}
const value = this.#rear.val; // Store tail node value
// When the deque has one element, front and rear point to the same node
if (this.#queSize === 1) {
this.#front = null;
this.#rear = null;
}
// Update tail node
let temp = this.#rear.prev;
if (temp !== null) {
else {
let temp = this.#rear.prev;
temp.next = null;
this.#rear.prev = null;
this.#rear = temp; // Update tail node
}
this.#rear = temp; // Update tail node
this.#queSize--;
return value;
}
@@ -83,14 +88,19 @@ class LinkedListDeque {
if (this.#queSize === 0) {
return null;
}
const value = this.#front.val; // Store tail node value
const value = this.#front.val; // Store the head node value
// When the deque has one element, front and rear point to the same node
if (this.#queSize === 1) {
this.#front = null;
this.#rear = null;
}
// Delete head node
let temp = this.#front.next;
if (temp !== null) {
else {
let temp = this.#front.next;
temp.prev = null;
this.#front.next = null;
this.#front = temp; // Update head node
}
this.#front = temp; // Update head node
this.#queSize--;
return value;
}