10 lines
151 B
Plaintext
10 lines
151 B
Plaintext
|
kruscal(G, w):
|
|||
|
A <- null
|
|||
|
for v <20><> V[G]:
|
|||
|
create_set(v)
|
|||
|
sort(E)
|
|||
|
for (u, v) <20><> E:
|
|||
|
if find_set(u) != find_set(v):
|
|||
|
A <- A + {(u,v)}
|
|||
|
|
|||
|
return A
|