Minimum Spanning Tree

2

1 votes
Easy
Problem

Given n( no of nodes of the graph) and e no of edges of the graph followed by edges b/w vertexes and weight as input, calculate the minimum spanning trees cost.

Note1: it is guaranteed that the given graph is not a disjoint.

Note2: You can use any algorithm( prims and kruskal's).

Sample Input
8 8
0 4 6
0 2 2
2 6 3
6 5 5
6 7 4
5 7 4
0 3 7
3 1 6
Sample Output
32
Time Limit: 5
Memory Limit: 256
Source Limit:
Contributers:
Editor Image

?