Files
hello-algo/ja/codes/dart/utils/vertex.dart
Yudong Jin 7257641e0e 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
2026-10-30 02:12:26 +08:00

30 lines
646 B
Dart

/**
* File: Vertex.dart
* Created Time: 2023-05-15
* Author: liuyuxin (gvenusleo@gmail.com)
*/
/* 頂点クラス */
class Vertex {
int val;
Vertex(this.val);
/* 値のリスト vals を入力し、頂点のリスト vets を返す */
static List<Vertex> valsToVets(List<int> vals) {
List<Vertex> vets = [];
for (int i in vals) {
vets.add(Vertex(i));
}
return vets;
}
/* 頂点のリスト vets を入力し、値のリスト vals を返す */
static List<int> vetsToVals(List<Vertex> vets) {
List<int> vals = [];
for (Vertex vet in vets) {
vals.add(vet.val);
}
return vals;
}
}