[PR #1478] kruskal.c #2079

Open
opened 2026-01-29 15:28:27 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/TheAlgorithms/C/pull/1478

State: closed
Merged: No


Added Kruskal's Algorithm in C
Implemented Kruskal’s Algorithm using Union-Find (Disjoint Set).
Takes user input, sorts edges, builds MST, and prints total weight.
File: kruskal.c

Sample Input:

4 5
0 1 10
0 2 6
0 3 5
1 3 15
2 3 4

Sample Output:

Edges in Minimum Spanning Tree:
2 - 3 : 4
0 - 3 : 5
0 - 1 : 10
Total Weight of MST: 19

**Original Pull Request:** https://github.com/TheAlgorithms/C/pull/1478 **State:** closed **Merged:** No --- Added Kruskal's Algorithm in C Implemented Kruskal’s Algorithm using Union-Find (Disjoint Set). Takes user input, sorts edges, builds MST, and prints total weight. File: kruskal.c Sample Input: 4 5 0 1 10 0 2 6 0 3 5 1 3 15 2 3 4 Sample Output: Edges in Minimum Spanning Tree: 2 - 3 : 4 0 - 3 : 5 0 - 1 : 10 Total Weight of MST: 19
claunia added the pull-request label 2026-01-29 15:28:27 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/C#2079