## Sum of the minimum elements in all connected components of an undirected graph

Given an array A of N numbers where Ai represent the value of the (i+1)th node. Also given are M pair of edges where u… Read More »

Given an array A of N numbers where Ai represent the value of the (i+1)th node. Also given are M pair of edges where u… Read More »

Permutation A permutation is an arrangement of elements. A permutation of n elements can be represented by an arrangement of the numbers 1, 2, …n… Read More »

Given a set of ‘n’ vertices and ‘m’ edges of an undirected simple graph (no parallel edges and no self-loop), find the number of single-cycle-components… Read More »

Consider a tree with n nodes and root. You can jump from one node to any other node on the same height a maximum of… Read More »

Given a tree and weights of nodes. Weights are non-negative integers. Task is to find maximum size of a subtree of a given tree such… Read More »

Given a graph with N nodes numbered from 1 to N and M edges and an array of numbers from 1 to N. Check if… Read More »

Given an undirected graph, task is to find the minimum number of weakly connected nodes after converting this graph into directed one. Weakly Connected Nodes… Read More »

Given an undirected colored graph(edges are colored), with a source vertex ‘s’ and a destination vertex ‘d’, print number of paths which from given ‘s’… Read More »

Given n and k, Construct a palindrome of size n using a binary number of size k repeating itself to wrap into the palindrome. The… Read More »

Given an array A of integers. Index i of A is said to be connected to index j if j = (i + A[i]) %… Read More »

Given n nodes of a forest (collection of trees), find the number of trees in the forest. Examples : Input : edges[] = {0, 1},… Read More »

Every house in the colony has at most one pipe going into it and at most one pipe going out of it. Tanks and taps… Read More »

Given an undirected graph and a set of vertices, we have to count the number of non reachable nodes from the given head node using… Read More »

Round 1: The first round consisted of two coding questions to be solved in 1 hr – Given a binary tree, print the boundary of… Read More »

Count the total number of ways or paths that exist between two vertices in a directed graph. These paths doesn’t contain a cycle, the simple… Read More »