Write a program to find the minimum weight spanning tree of an undirected weighted graph using either Prim's or Kruskal's algorithm.
Take input from stdin and print output to stdout.
Take input as n the number of nodes, m is the number of edges.
Next m lines contain u, v, and w i.e there is an edge between node u and node v with weight w.
Then print the MST of the graph.
Details
Technical Specifications: Preferred languages are C/C++/Python
Create a folder named '57'(57 as in the issue number) in 'algorithms' folder. Name your program file as 'MST.c' or 'MST.cpp' or 'MST.py'. Add this program file to the folder '/algorithms/57'.
Note
Please claim the issue first by commenting here before starting to work on it.
For co-ordinators/maintainers creating the issues
Please mention yourself as the point of contact so that the person submitting the PR can request review from @NKH123.
Doubts and clarifications are welcome.
Description
Write a program to find the minimum weight spanning tree of an undirected weighted graph using either Prim's or Kruskal's algorithm. Take input from stdin and print output to stdout. Take input as n the number of nodes, m is the number of edges. Next m lines contain u, v, and w i.e there is an edge between node u and node v with weight w. Then print the MST of the graph.
Details
Issue requirements / progress
Resources
https://en.wikipedia.org/wiki/Minimum_spanning_tree
Directory Structure
Create a folder named '57'(57 as in the issue number) in 'algorithms' folder. Name your program file as 'MST.c' or 'MST.cpp' or 'MST.py'. Add this program file to the folder '/algorithms/57'.
Note
Please claim the issue first by commenting here before starting to work on it.
For co-ordinators/maintainers creating the issues
Please mention yourself as the point of contact so that the person submitting the PR can request review from @NKH123. Doubts and clarifications are welcome.