## Count of subtrees from an N-ary tree consisting of single colored nodes

Given a N-ary tree consisting of N nodes and a matrix edges[][] consisting of N – 1 edges of the form (X, Y) denoting the… Read More »

Given a N-ary tree consisting of N nodes and a matrix edges[][] consisting of N – 1 edges of the form (X, Y) denoting the… Read More »

Given two N-ary trees having M nodes each. Also, given their edges and their roots respectively. The task is to check if they are isomorphic… Read More »

Given an N-Ary tree containing N nodes and an array weight [ ] that denotes the weight of the nodes which can be positive or… Read More »

Given a n-ary tree having nodes with a particular weight, our task is to find out the maximum sum of the minimum difference of divisors… Read More »

Given an N-ary Tree containing N nodes, values associated with each node and Q queries, where each query contains a single node. The task is… Read More »

Given an N-ary tree with weighted edge and Q queries where each query contains two nodes of the tree. The task is to find the… Read More »

Given an N-ary tree, the task is to print the N-ary tree graphically. Graphical Representation of Tree: A representation of tree in which the root… Read More »

Prerequisite: Segment tree and depth first search. In this article, an approach to convert an N-ary rooted tree( a tree with more than 2 children)… Read More »

Given an N-ary tree containing, the task is to print the inorder traversal of the tree. Examples: Input: N = 3 Output: 5 6 2… Read More »

Given an N-ary tree, the task is to find the post-order traversal of the given tree iteratively. Examples: Input: 1 / | \ 3 2… Read More »

Given a Binary Tree rooted at node 1, the task is to print the elements in the following defined order. First, print all elements of… Read More »

Given a tree with N vertices numbered from 0 to N – 1 and Q queries containing nodes in the tree, the task is to… Read More »

Given a tree with N vertices numbered from 0 to N – 1 and Q query containing nodes in the tree, the task is to… Read More »

Given a set of parent nodes where the index of the array is the child of each Node value, the task is to insert the… Read More »

Given an n-ary tree, the task is to check whether the given tree is binary or not. Examples: Input: A / \ B C /… Read More »