Skip to content

kruskal.c #1478

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

kruskal.c #1478

wants to merge 1 commit into from

Conversation

xoxo444
Copy link

@xoxo444 xoxo444 commented Aug 1, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant