## Queries for the number of nodes having values less than V in the subtree of a Node

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 »

- Difference Between BFS and DFS
- Program to count Number of connected components in an undirected graph
- Check if a directed graph is connected or not
- Minimum steps to color the tree with given colors
- Minimum number of pairs required to make two strings same
- Sum of the distances from every node to all other nodes is maximum
- Maximum number of nodes which can be reached from each node in a graph.
- Find K vertices in the graph which are connected to at least one of remaining vertices
- Print all leaf nodes of an n-ary tree using DFS
- Count the nodes of the given tree whose weighted string is a palindrome
- Count the nodes of the tree which make a pangram when concatenated with the sub-tree nodes
- Find the Kth node in the DFS traversal of a given subtree in a Tree
- Find the node whose xor with x gives minimum value
- GCD from root to leaf path in an N-ary tree
- Count the nodes of the given tree whose weight has X as a factor
- Find number of edges that can be broken in a tree such that Bitwise OR of resulting two trees are equal
- Count the nodes in the given tree whose weight is even parity
- Find the node whose sum with X has minimum set bits
- Construct the Rooted tree by using start and finish time of its DFS traversal
- Find the root of the sub-tree whose weighted sum XOR with X is maximum
- Count the nodes whose sum with X is a Fibonacci number
- Find the node whose xor with x gives maximum value
- 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
- Find the node whose sum with X has maximum set bits
- Count the nodes of a tree whose weighted string does not contain any duplicate characters
- Count the nodes of the tree whose weighted string contains a vowel
- Find the node whose absolute difference with X gives maximum value
- Find the node whose absolute difference with X gives minimum value
- Queries for the number of nodes having values less than V in the subtree of a Node

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 with N nodes and N-1 edges with root at 1 and given an array of N-1 integers. The task is to assign… Read More »

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 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 start and finish times of DFS traversal of N vertices that are available in a Rooted tree, the task is to construct the tree… 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 does… 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:… 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 (in the form of strings) of all the nodes, the task is to count the nodes whose weights contain… Read More »

Breadth First Search BFS stands for Breadth First Search is a vertex based technique for finding a shortest path in graph. It uses a Queue… 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 an array edge[][2] where (edge[i][0], edge[i][1]) defines an edge in the n-ary tree, the task is to print all the leaf nodes of the… Read More »

Given two strings s1 and s2 of same length, the task is to count the minimum number of pairs of characters (c1, c2) such that… Read More »