# Tag Archives: Minimum Spanning Tree

Prerequisites – Graph, Spanning tree, Disjoint Set (Union – Find). A minimum spanning tree (MST) T, for a given graph G, spans over all verticesâ€¦ Read More
For a connected and undirected graph, a spanning tree of that graph is a subgraph that is a tree and connects all the vertices together.â€¦ Read More
Given an integer N, denoting the number of computers connected by cables forming a network and a 2D array connections[][], with each row (i, j)â€¦ Read More
Given a 2D array houses[][] consisting of N 2D coordinates {x, y} where each coordinate represents the location of each house, the task is toâ€¦ Read More
Given a graph with N nodes and M edges where each edge has a color (either black or green) and a cost associated with it.â€¦ Read More
Given an undirected unweighted connected graph consisting of n vertices and m edges. The task is to find any spanning tree of this graph suchâ€¦ Read More
Given a connected undirected weighted graph with N nodes and M edges. The task is to perform given queries and find the weight of theâ€¦ Read More
Given an undirected graph of V nodes (V > 2) named V1, V2, V3, …, Vn. Two nodes Vi and Vj are connected to eachâ€¦ Read More
Introduction to Prim’s algorithm: We have discussed Kruskal’s algorithm for Minimum Spanning Tree. Like Kruskal’s algorithm, Primâ€™s algorithm is also a Greedy algorithm. This algorithm always startsâ€¦ Read More