mirror of
https://github.com/krahets/hello-algo.git
synced 2026-11-26 22:42:41 +08:00
* 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
30 lines
646 B
Dart
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;
|
|
}
|
|
}
|