Kruskal’s algorithm is used to find MST in a graph. It is a greedy based algorithm.
The graph should be connected, undirected, and weighted for Kruskal’s algorithm to work.
The working of Kruskal’s algorithm involves sorting edges, connecting edges with the smallest weight, checking for cycles, and repeating until all vertices are connected.
An example is provided to illustrate the steps of Kruskal’s algorithm, and an implementation of the algorithm in C++ is included.