๊ทธ๋ฆฌ๋(Greedy) - ์ต์์ ์ฅํธ๋ฆฌ(MST)
ยท
๐ป ์๊ณ ๋ฆฌ์ฆ/์ด๋ก
kruskal ์๊ณ ๋ฆฌ์ฆ ๊ตฌํ(c์ธ์ด) #include #include typedef struct Edge { char v1, v2; int weight; struct Edge* next; }Edge; typedef struct IncidentEdge { char aName; Edge* e; struct IncidentEdge* next; }IncidentEdge; typedef struct Vertex { char vName; IncidentEdge* iHead; struct Vertex* next; }Vertex; typedef struct { Vertex* vHead; Edge* eHead; int eCount, vCount; }Graph; void init(Graph* G) { G->vHead = ..