## Number of ways to paint a tree of N nodes with K distinct colors with given conditions

Given a tree with N nodes and a number K. Paint every node of the tree in one of the K available colors. Count and… Read More »

- Check if given Preorder, Inorder and Postorder traversals are of same tree | Set 2
- Remove minimum elements from either side such that 2*min becomes more than max | Set 2
- Kth smallest element in a subarray
- Introduction to Data Structures | 10 most commonly used Data Structures
- Total number of possible Binary Search Trees using Catalan Number
- Iterative Postorder traversal | Set 3
- Convert a given Binary Tree to Circular Doubly Linked List | Set 2
- Adobe Interview Experience ( 3 Years Exp )
- LCA in a tree using Binary Lifting Technique
- Find the node with maximum value in a Binary Search Tree using recursion
- Spanning Tree With Maximum Degree (Using Kruskal's Algorithm)
- Sum of nodes in bottom view of Binary Tree
- Check if the given Binary Tree have a Subtree with equal no of 1's and 0's
- Print all leaf nodes of a binary tree from right to left
- Check if two nodes in a Binary Tree are siblings
- Create a mirror tree from the given binary tree
- Print Binary Tree levels in sorted order | Set 3 (Tree given as array)
- K-th ancestor of a node in Binary Tree | Set 3
- Print path from root to all nodes in a Complete Binary Tree
- Lazy Propagation in Segment Tree | Set 2
- Sum of nodes in top view of binary tree
- Pair with a given sum in BST | Set 2
- Maximum sub-tree sum in a Binary Tree such that the sub-tree is also a BST
- Check if the given binary tree has a sub-tree with equal no of 1's and 0's | Set 2
- Clockwise Spiral Traversal of Binary Tree | Set - 2
- Find the node with minimum value in a Binary Search Tree using recursion
- Minimum steps to color the tree with given colors
- Construct BST from its given level order traversal | Set-2
- Minimum sum path between two leaves of a binary tree
- Sum of the distances from every node to all other nodes is maximum

Given a tree with N nodes and a number K. Paint every node of the tree in one of the K available colors. Count and… Read More »

Given a Prufer sequence of N integers, the task is to check if the given sequence is a valid Prufer sequence or not. 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 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 Prufer sequence, the task is to find the degrees of all the nodes of the tree made by the prufer sequence. Examples: Input:… 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:… 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 »

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 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 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 »