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
Tag Archives: Kruskal’sAlgorithm
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 N nodes on a 2-D plane represented as (xi, yi). The nodes are said to be connected if the manhattan distance between them is… 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
A minimum spanning tree (MST) or minimum weight spanning tree for a weighted, connected, undirected graph is a spanning tree with a weight less than… Read More