// 遍历result中的每一条边,每次循环将当前边赋值给变量edge for (const auto& edge : result) { // 找到edge中两个顶点的索引,分别赋值给idx1和idx2 int idx1 = edge.src; int idx2 = edge.tgt; }

注释代码for const auto& edge result遍历所有生成树的边					int idx1 = edgesrc;找到最小生成组成边两点的索引			int idx2 = edgetgt;

原文地址: https://www.cveoy.top/t/topic/hQLB 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录