Skip to content

Tag Archives: connected-components

Connected component in an undirected graph refers to a group of vertices that are connected to each other through edges, but not connected to other… Read More
Strongly Connected Component (SCC) is a concept in graph theory, specifically in directed graphs. A subgraph of a directed graph is considered to be an… Read More
Given an undirected graph of N node, where nodes are numbered from 1 to N, and an array of edges, where edges[i] = {edgeType, u,… Read More
Given N nodes, where each of them is numbered from 0 to N – 1, and array edges, where there is a directed edge from… Read More
Given a directed graph with N nodes and M edges in array V[], the task is to find the number of nodes that are accessible… Read More
Given an undirected graph g, the task is to find the number of coalitions formed in it after the removal of Q vertices and maximum… Read More
Given, a Tree with N nodes, and an integer P, the task is to remove at edges in range [1, P) and find the XOR… Read More
Given an array A[] of size N, for each index i in the range [0, N) the value A[i] denotes the size of the connected… Read More
Given a matrix mat[][] containing only of 0s and 1s, and an array queries[], the task is for each query, say k, is to find… Read More
Given an array arr[] consisting of N strings representing the name of the students in the class and another array of pairs P[][2] such that… Read More
Given an array arr[] consisting of values of N vertices of an initially unconnected Graph and an integer M, the task is to connect some… Read More
Given an undirected graph consisting of V vertices and a 2d array E[][2] denoting edges between pairs of nodes. Given another array arr[] representing values… Read More
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
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