~/ learn/ comp-372/ cards/ Kruskal's algorithm
1 of 4

Type the CLRS MST-KRUSKAL pseudocode

Type the CLRS MST-KRUSKAL pseudocode

Answer

A = {} for each vertex v in G.V: MAKE-SET(v) sort G.E by non-decreasing weight w for each edge (u, v) in sorted order: if FIND-SET(u) != FIND-SET(v): A = A union {(u, v)} UNION(u, v) return A

Sorting the edges is the O(E lg V) bottleneck; the union-find operations are near-linear. Adding only cross-component edges keeps A a forest and, by Corollary 21.2, a subset of some MST.

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/6870d3ef-781d-4dae-849d-57704711e972/flashcard utf-8 LF