Re-translate the Japanese version (#1871)

* Retranslate Japanese docs with GPT-5.4

* Retranslate Japanese code with GPT-5.4
This commit is contained in:
Yudong Jin
2026-03-30 07:30:15 +08:00
committed by GitHub
parent fe6443235b
commit d7b2277d2b
1444 changed files with 83312 additions and 8363 deletions
@@ -12,15 +12,15 @@ import java.util.*;
public class hashing_search {
/* ハッシュ探索(配列) */
static int hashingSearchArray(Map<Integer, Integer> map, int target) {
// ハッシュテーブルのキー: 目標要素、: インデックス
// ハッシュテーブルにこのキーが含まれていない場合、-1 を返す
// ハッシュテーブルの key: 目標要素、value: インデックス
// ハッシュテーブルにこの key がなければ -1 を返す
return map.getOrDefault(target, -1);
}
/* ハッシュ探索(連結リスト) */
static ListNode hashingSearchLinkedList(Map<Integer, ListNode> map, int target) {
// ハッシュテーブルのキー: 目標ノード値、: ノードオブジェクト
// キーがハッシュテーブルにない場合、null を返す
// ハッシュテーブルの key: 目標ノード値、value: ノードオブジェクト
// ハッシュテーブルにこの key がなければ null を返す
return map.getOrDefault(target, null);
}
@@ -32,20 +32,20 @@ public class hashing_search {
// ハッシュテーブルを初期化
Map<Integer, Integer> map = new HashMap<>();
for (int i = 0; i < nums.length; i++) {
map.put(nums[i], i); // キー: 要素、: インデックス
map.put(nums[i], i); // key: 要素、value: インデックス
}
int index = hashingSearchArray(map, target);
System.out.println("目標要素 3 のインデックス " + index);
System.out.println("対象要素 3 のインデックス = " + index);
/* ハッシュ探索(連結リスト) */
ListNode head = ListNode.arrToLinkedList(nums);
// ハッシュテーブルを初期化
Map<Integer, ListNode> map1 = new HashMap<>();
while (head != null) {
map1.put(head.val, head); // キー: ノード値、: ノード
map1.put(head.val, head); // key: ノード値、value: ノード
head = head.next;
}
ListNode node = hashingSearchLinkedList(map1, target);
System.out.println("目標ノード値 3 に対応するノードオブジェクトは " + node);
System.out.println("対象ノード値 3 に対応するノードオブジェクトは " + node);
}
}
}