mirror of
https://github.com/krahets/hello-algo.git
synced 2026-06-16 07:08:21 +08:00
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:
35
ja/codes/javascript/modules/Vertex.js
Normal file
35
ja/codes/javascript/modules/Vertex.js
Normal file
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* File: Vertex.js
|
||||
* Created Time: 2023-02-15
|
||||
* Author: Zhuo Qinyue (1403450829@qq.com)
|
||||
*/
|
||||
|
||||
/* 頂点クラス */
|
||||
class Vertex {
|
||||
val;
|
||||
constructor(val) {
|
||||
this.val = val;
|
||||
}
|
||||
|
||||
/* 値リスト vals を入力し、頂点リスト vets を返す */
|
||||
static valsToVets(vals) {
|
||||
const vets = [];
|
||||
for (let i = 0; i < vals.length; i++) {
|
||||
vets[i] = new Vertex(vals[i]);
|
||||
}
|
||||
return vets;
|
||||
}
|
||||
|
||||
/* 頂点リスト vets を入力し、値リスト vals を返す */
|
||||
static vetsToVals(vets) {
|
||||
const vals = [];
|
||||
for (const vet of vets) {
|
||||
vals.push(vet.val);
|
||||
}
|
||||
return vals;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
Vertex,
|
||||
};
|
||||
Reference in New Issue
Block a user