Given an N-ary Tree consisting of nodes valued [1, N] and an array value[], where each node i is associated with value[i], the task is… Read More

# Tag Archives: tree-level-order

Given an array arr[] representing a Generic(N-ary) tree. The task is to replace the node data with the depth(level) of the node. Assume level of… Read More

Given a Binary Tree, the task is to perform Specific Level Order Traversal of the tree such that at each level print 1st element then… Read More

Given a Binary Tree, the task is to check if the maximum sum level divides the binary tree into the two parts of two equal… Read More

Given a binary tree, the task is to traverse the Binary Tree in level order fashion. Examples: Input: 1 / \ 2 3 Output: 1… Read More

Given a Binary Tree having positive and negative nodes, the task is to find the maximum absolute difference of level sum in it. Examples: Input:… Read More

Given a tree, our task is to check whether its left view is sorted or not. If it is then return true else false. Examples:… Read More

Given a number K, the task is to create the Diamond-like structure of Tree which follows these two conditions: First K levels of the tree… Read More

Given a Binary Tree, the task is to print all the Exponential Levels in the given Binary Tree. An Exponential Level is a level whose… Read More

Given two Binary Trees we have to detect if the two trees are Isomorphic. Two trees are called isomorphic if one of them can be… Read More

Given a Binary Tree and an integer K where the tree has positive and negative nodes, the task is to print the elements of the… Read More

Given a Binary Tree, the task is to print all levels of this tree in Boundary Level order traversal. Boundary Level order traversal: In this… Read More

Given a Binary Tree, the task is to count the nodes whose immediate children are co-prime. Examples: Input: 1 / \ 15 5 / \ /… Read More

Given a Binary Tree, the task is to print the count of nodes whose either of the immediate child is its prime factors. Examples: Input: 1… Read More

Given a Binary Tree, the task is to print the count of nodes whose immediate children are its factors. Examples: Input: 1 / \ 15 20… Read More