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

View File

@@ -6,7 +6,7 @@
#include "../utils/common.hpp"
/* キー値ペア */
/* キーと値の組 */
struct Pair {
public:
int key;
@@ -17,19 +17,19 @@ struct Pair {
}
};
/* 配列実装に基づくハッシュテーブル */
/* 配列ベースのハッシュテーブル */
class ArrayHashMap {
private:
vector<Pair *> buckets;
public:
ArrayHashMap() {
// 配列を初期化、100個のバケットを含む
// 100 個のバケットを含む配列を初期化
buckets = vector<Pair *>(100);
}
~ArrayHashMap() {
// メモリを解放
// メモリを解放する
for (const auto &bucket : buckets) {
delete bucket;
}
@@ -42,7 +42,7 @@ class ArrayHashMap {
return index;
}
/* クエリ操作 */
/* 検索操作 */
string get(int key) {
int index = hashFunc(key);
Pair *pair = buckets[index];
@@ -61,12 +61,12 @@ class ArrayHashMap {
/* 削除操作 */
void remove(int key) {
int index = hashFunc(key);
// メモリを解放してnullptrに設定
// メモリを解放して nullptr に設定する
delete buckets[index];
buckets[index] = nullptr;
}
/* すべてのキーペアを取得 */
/* すべてのキーと値のペアを取得 */
vector<Pair *> pairSet() {
vector<Pair *> pairSet;
for (Pair *pair : buckets) {
@@ -99,7 +99,7 @@ class ArrayHashMap {
return valueSet;
}
/* ハッシュテーブルを印刷 */
/* ハッシュテーブルを出力 */
void print() {
for (Pair *kv : pairSet()) {
cout << kv->key << " -> " << kv->val << endl;
@@ -107,4 +107,4 @@ class ArrayHashMap {
}
};
// テストケースはarray_hash_map_test.cppを参照
// テストケースは `array_hash_map_test.cpp` を参照