leetcode连接所有点的最小费用与Krustal算法模板
class Solution {private: struct Edge { int u, v, cost; bool operator<(const Edge& in)const { return cost < in.cost; } }; vector<Edge>edges; vector<int>parent;public: int minCostConnectPoints(vector<vector<in
原创
2020-09-16 22:13:21 ·
170 阅读 ·
0 评论