Created
January 4, 2021 01:53
-
-
Save wkdalsgh192/d3b79b330401c15595a6b6c7cf228a3f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
KRUSKAL(G): | |
A = ∅ | |
For each vertex v ∈ G.V: | |
MAKE-SET(v) | |
For each edge (u, v) ∈ G.E ordered by increasing order by weight(u, v): | |
if FIND-SET(u) ≠ FIND-SET(v): | |
A = A ∪ {(u, v)} | |
UNION(u, v) | |
return A |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment