Skip to content
CampusEduX

Minimum Spanning Tree

Hardjavapythonccppjavascript

Given a connected weighted undirected graph, find the total weight of its Minimum Spanning Tree.

Input Format

The first line contains two integers V and E. Each of the next E lines contains an undirected weighted edge u v w.

Output Format

Print the total weight of the Minimum Spanning Tree.

Related Problems

  • Dijkstra Shortest Path
    Hard · java, python, c, cpp, javascript
    Solve Problem
  • Graph Using Adjacency List
    Easy · java, python, c, cpp, javascript
    Solve Problem
  • BFS Traversal
    Easy · java, python, c, cpp, javascript
    Solve Problem

Input (stdin)

Output

Run your code to see output here...