Kruskal’s Algorithm in C

Kruskal’s Algorithm in C: Kruskal’s algorithm takes a different approach from Prim’s algorithm. Where Prim builds the MST by choosing edges that always form a connected tree and expanding it until it is a spanning tree, Kruskal chooses edges from different parts of the graph and eventually joins them together to create the MST.

Kruskal’s Algorithm

  1. List all the edge of the graph in the order of increasing weight.
  2. Select the samllest edge of the graph G.
  3. Then select another smallest edge that do not makes any circle.
  4. Continue this process until (n-1) edges have been selected.
Kruskal's Algorithm in C
Kruskal's Algorithm in C

C Program for Kruskal’s Algorithm

OUTPUT of Kruskal’s Algorithm in C

Kruskal's Algorithm in C

You can learn about more C program and for queries go to quora