Skip to content

Commit 0785f30

Browse files
committed
fix: modified kruskal implementation to conform to the updated Union method
1 parent 2ca8ae2 commit 0785f30

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

graph/kruskal.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func KruskalMST(n int, edges []Edge) ([]Edge, int) {
4242
// Add the weight of the edge to the total cost
4343
cost += edge.Weight
4444
// Merge the sets containing the start and end vertices of the current edge
45-
u = u.Union(int(edge.Start), int(edge.End))
45+
u.Union(int(edge.Start), int(edge.End))
4646
}
4747
}
4848

0 commit comments

Comments
 (0)