/** * File: Vertex.dart * Created Time: 2023-05-15 * Author: liuyuxin (gvenusleo@gmail.com) */ /* 顶点类 */ class Vertex { int val; Vertex(this.val); /* 输入值列表 vals ,返回顶点列表 vets */ static List valsToVets(List vals) { List vets = []; for (int i in vals) { vets.add(Vertex(i)); } return vets; } /* 输入顶点列表 vets ,返回值列表 vals */ static List vetsToVals(List vets) { List vals = []; for (Vertex vet in vets) { vals.add(vet.val); } return vals; } }