# Tag Archives: connected-components

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
Given an undirected graph, the task is to find the size of each connected component and print the number of unique sizes of connected components … Read More
Given an undirected graph with V vertices and E edges, the task is to find all the connected components of the graph and check if… Read More