Algorithm/Graph-Minimum Spanning Tree (1) 썸네일형 리스트형 LAN #include #include #include #include #define MAX_V 99999 #define INF 987654321 using namespace std; double kruskalExtension(vector & selected, vector & preConnected); int prim(vector & selected); typedef struct DisjointSet { vector parent, rank; DisjointSet(int n) : parent(n), rank(n, 1) { for (int i = 0; i < n; i++) parent[i] = i; } int find(int u) { if (parent[u] == u) return u; return parent[u.. 이전 1 다음