Given an undirected graph G with vertices numbered in the range [1, N] and an array Edges[][] consisting of M edges, the task is to… Read More

# Tag Archives: connected-components

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 an undirected graph G with vertices numbered in the range [0, N] and an array Edges[][] consisting of M edges, the task is to… Read More

Given an n-ary tree T, the task is to find a node whose removal minimizes the maximum size of all forests(connected components) generated. Examples: Input: … Read More

Given an undirected graph G with N nodes, M edges, and an integer K, the task is to find the maximum count of edges that… Read More

Given a Tree consisting of N nodes valued in the range [0, N) and an array Queries[] of Q integers consisting of values in the… Read More

Given an undirected graph consisting of N nodes containing values from the range [1, N] and M edges in a matrix Edges[][], the task is… Read More

Given two arrays A[] and B[] consisting of N positive integers and a matrix List[][] consisting of M pairs of indices, the task is to… Read More

Given a Tree having N nodes connected by N − 1 edge and a single disconnected node, the task is to find the diameters for… Read More

Given an undirected graph consisting of N vertices and M edges and queries Q[][] of the type {X, Y}, the task is to check if… Read More

Given two integers V and E representing the number of vertices and edges of an undirected graph G(V, E), a list of edges EdgeList, and… Read More

Given a binary valued undirected graph with V vertices and E edges, the task is to find the hexadecimal equivalents of all the connected components… Read More

Given a binary-valued Undirected Graph with V vertices and E edges, the task is to find the maximum decimal equivalent among all the connected components… Read More

Given a binary valued undirected graph with V vertices and E edges, the task is to find the octal equivalents of all the connected components… Read More

Given an undirected graph with V vertices and E edges. Every node has been assigned a given value. The task is to find the connected… Read More