New update is available. Click here to update.

Posted: 16 Sep, 2017

Difficulty: Hard

```
1. In one line, print an edge which is part of MST in the format -
v1 v2 w
where, v1 and v2 are the vertices of the edge which is included in MST and whose weight is w. And v1 <= v2 i.e. print the smaller vertex first while printing an edge.
2. Print V-1 edges in above format in different lines.
```

```
Line 1: Two Integers V and E (separated by space)
Next E lines : Three integers ei, ej and wi, denoting that there exists an edge between vertex ei and vertex ej with weight wi (separated by space)
```

```
Print the MST, as described in the task.
```

```
2 <= V, E <= 10^5
Time Limit: 1 sec
```

SIMILAR PROBLEMS

Eulerian Circuit

Posted: 19 Jan, 2022

Difficulty: Hard

Minimum Swaps To Make Identical Array

Posted: 22 Jan, 2022

Difficulty: Moderate

Find Center of Star Graph

Posted: 26 Jan, 2022

Difficulty: Easy

Critical Connections in a Network

Posted: 27 Jan, 2022

Difficulty: Hard

Critical Connections in a Network

Posted: 27 Jan, 2022

Difficulty: Hard

COUNT ISLANDS

Posted: 14 Sep, 2022

Difficulty: Moderate

Categories:

Popular Courses: