## Print all neighbour nodes within distance K

Given a graph of N nodes, E edges, a node X and a distance K. The task is to print all the nodes within the… Read More »

- Print all neighbour nodes within distance K
- Find the root of the sub-tree whose weighted sum is minimum
- Count the nodes of the tree which make a pangram when concatenated with the sub-tree nodes
- Count the nodes in the given tree whose weight is even parity
- Count the nodes in the given tree whose weight is even
- Count the nodes in the given tree whose sum of digits of weight is odd
- Find the node whose sum with X has minimum set bits
- Count the nodes of a tree whose weighted string is an anagram of the given string
- Count the nodes whose weight is a perfect square
- Count the nodes in the given tree whose weight is a power of two
- Find the root of the sub-tree whose weighted sum XOR with X is minimum
- Queries for the number of nodes having values less than V in the subtree of a Node
- Find the node whose absolute difference with X gives minimum value

Given a graph of N nodes, E edges, a node X and a distance K. The task is to print all the nodes within the… Read More »

Given a rooted tree (assume root is 1) of N nodes and Q queries, each of the form (Val, Node). For each query, the task… 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 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 »

Given a tree, and the weights of all the nodes, the task is to find the root of the sub-tree whose weighted sum is minimum.… Read More »

Given a tree, and the weights of all the nodes, the task is to find the root of the sub-tree whose weighted sum XOR with… Read More »

Given a tree, and the weights of all the nodes, the task is to count the number of nodes whose weight is even. Examples: Input:… 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 perfect Square.… Read More »

Given a tree, and the weights of all the nodes and an integer x, the task is to find a node i such that weight[i]… Read More »

Given a tree, and the weights of all the nodes and an integer x, the task is to find a node i such that |weight[i]… Read More »

Given a tree with N nodes, and two integers K and V. The task is to find the Kth node in the DFS traversal of… Read More »

Graph : A graph is collection of two sets V and E where V is a finite non-empty set of vertices and E is a… Read More »