I need Linked list implementation implementation for the following problem:
Implement Disjoint Sets data structure. You should implement the data structure as a disjoint-set forests along with the heuristics union by rank and path compression.
Using the Disjoint-Set data structure implement Krushkal's Algorithm for Minimum Spanning Tree for a weighted undirected graph.
The graph will be passed through a text file as command line argument. You need to display the edges of the MST along with total weight.
For example graph will be in the following format (for K_4, complete graph on 4 vertices)
4 6
1 2 5
1 3 10
1 4 2
2 3 20
2 4 15
3 4 6
Edges of the MST {(1, 2), (1, 4), (3, 4)}, Total Weight: 13
Comments
Leave a comment