/** * 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; } }