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
Category Archives: Graph
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