[자료구조] minimum spanning tree - prim's algorithim, kruskal's algrithm
최소의 총 가중치를 갖는 spanning tree를 찾는 방법 중 prim's algorithim과 kruskal's algrithm에 대해 알아보겠다. spanning tree에 대한 글은 아래 참고 2022.07.01 - [자료구조] - [자료구조] spanning tree (sub graph) [자료구조] spanning tree (sub graph) spanning tree: 그래프에서 cycle이 제거된 sub graph -Depth First Traversal을 이용해 spanning tree 만들기 먼저 DFS방식으로 그래프를 순회한다. 위의 그림에서 서로 연결된 노드들만 그래프에서 다시 연결.. jicoding.tistory.com - Prim's algorithm 1. undirected..
자료구조
2022. 7. 4. 13:30