# Category Archives: Graph

Given a connected graph with N vertices. The task is to select k(k must be less than or equals to n/2, not necessarily minimum) verticesâ€¦ Read More
Given a binary search tree, and an integer X, the task is to check if there exists a pair of distinct nodes in BST withâ€¦ Read More
Given an undirected unweighted graph with N vertices and M edges. The task is to find two disjoint good sets of vertices. A set Xâ€¦ Read More
Given a graph with N nodes and K bidirectional edges between them find the number of nodes which can be reachable from a particular. Twoâ€¦ Read More
Given an integer L which is the sum of degrees of all the vertices of some tree. The task is to find the count ofâ€¦ Read More
Given a tree, and the weights (in the form of strings) of all the nodes, the task is to count the nodes whose weighted stringâ€¦ Read More
Given a tree, and the weights (in the form of strings) of all the nodes, the task is to count the nodes whose weighted stringâ€¦ Read More
Given a tree, and the weights (in the form of strings) of all the nodes, the task is to count the nodes whose weights doâ€¦ Read More
Given a Prufer sequence, the task is to find the degrees of all the nodes of the tree made by the prufer sequence.Examples:   Input: arr[]â€¦ Read More
Given a Prufer sequence of a Tree, the task is to print the node with the maximum degree in the tree whose Prufer sequence isâ€¦ Read More
Given a tree, and the weights of all the nodes, the task is to count the nodes whose weights are divisible by x.Examples:   Input:   xâ€¦ Read More
Given a tree, and the weights (in the form of strings) of all the nodes, the task is to count the nodes whose weights areâ€¦ Read More
Given a tree, and the weights of all the nodes, the task is to count the number of nodes whose sum of digits of weightsâ€¦ Read More
Given a tree and the weights of all the nodes, the task is to count the number of nodes whose weights are even parity i.e.â€¦ Read More
Given a tree, and the weights of all the nodes, the task is to count the number of nodes whose weight is a power ofâ€¦ Read More