Retranslate the complete Japanese online edition from Chinese (#2008)

* Retranslate the complete Japanese online edition from Chinese

* Fit Japanese homepage labels and localize heading permalinks

* Point Japanese contribution instructions to the Japanese preview

* Replace locale conditionals with multilingual UI tables
This commit is contained in:
Yudong Jin
2026-10-30 02:12:26 +08:00
committed by GitHub
parent 455e8c1281
commit 7257641e0e
1987 changed files with 23531 additions and 23261 deletions
+16 -16
View File
@@ -7,35 +7,35 @@
const { GraphAdjList } = require('./graph_adjacency_list');
const { Vertex } = require('../modules/Vertex');
/* 幅優先探索 */
// グラフを隣接リストで表し、指定した頂点の隣接頂点をすべて取得できるようにする
/* 幅優先走査 */
// 指定した頂点に隣接する全頂点を取得しやすいように、グラフを隣接リストで表す
function graphBFS(graph, startVet) {
// 頂点の走査順序
const res = [];
// 訪問済み頂点を記録するためのハッシュ集合
// 訪問済みの頂点を記録するハッシュ集合
const visited = new Set();
visited.add(startVet);
// BFS の実装にキューを用いる
// BFS の実装にキューを使う
const que = [startVet];
// 頂点 vet を起点に、すべての頂点を訪問し終えるまで繰り返す
// 頂点 vet を始点として、すべての頂点を訪問するまで繰り返す
while (que.length) {
const vet = que.shift(); // 先頭の頂点をデキュー
res.push(vet); // 訪問した頂点を記録
// この頂点のすべての隣接頂点を走査
const vet = que.shift(); // キューの先頭の頂点をデキューする
res.push(vet); // 訪問した頂点を記録する
// この頂点に隣接する全頂点を走査する
for (const adjVet of graph.adjList.get(vet) ?? []) {
if (visited.has(adjVet)) {
continue; // 訪問済みの頂点をスキップ
continue; // 訪問済みの頂点をスキップする
}
que.push(adjVet); // 未訪問の頂点のみをキューに追加
que.push(adjVet); // 未訪問の頂点だけをエンキューする
visited.add(adjVet); // この頂点を訪問済みにする
}
}
// 頂点の走査順を返す
// 頂点の走査順序を返す
return res;
}
/* Driver Code */
/* 無向グラフを初期化 */
/* 実行用コード */
/* 無向グラフを初期化する */
const v = Vertex.valsToVets([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
const edges = [
[v[0], v[1]],
@@ -52,10 +52,10 @@ const edges = [
[v[7], v[8]],
];
const graph = new GraphAdjList(edges);
console.log('\n初期化後のグラフは');
console.log('\n初期化後のグラフ');
graph.print();
/* 幅優先探索 */
/* 幅優先走査 */
const res = graphBFS(graph, v[0]);
console.log('\n幅優先探索(BFS)の頂点列は');
console.log('\n幅優先走査(BFS)の頂点の順序');
console.log(Vertex.vetsToVals(res));