Given an array pre[], representing the Preorder traversal of a Perfect Binary Tree consisting of N nodes, the task is to construct a Perfect Binary… Read More

# Tag Archives: tree-traversal

Given an N-ary Tree consisting of N nodes valued from [0, N – 1] and two binary arrays initial[] and final[] of size N such… Read More

Given a Binary Tree consisting of N nodes having values in the range [0, N – 1] rooted as 0, an array wt[] of size… Read More

Given a Binary Tree consisting of N nodes, the task is to replace each node of the tree with the product of all the remaining… Read More

Given a Binary Tree consisting of N nodes, the task is to find the minimum number of cameras required to monitor the entire tree such… Read More

Given a Binary Search Tree (BST)consisting of N nodes and two nodes A and B, the task is to find the median of all the… Read More

Given an N-ary tree consisting of N nodes, the task is to find the node having the largest value in the given N-ary Tree. Examples:… Read More

Given a Binary Tree consisting of N nodes having distinct values from the range [1, N], the task is to find the lowest common ancestor… Read More

Given a Binary Tree consisting of N nodes and two integers K and L, the task is to add one row of nodes of value… Read More

The tree is a hierarchical Data Structure. A binary tree is a tree that has at most two children. The node which is on the… Read More

Given a Binary Tree, the task is to modify the Tree by left rotating every node any number of times such that every level consists… Read More

Given a binary tree, the task is to print the inorder traversal of the modified tree obtained after shifting all the nodes of the given… Read More

Given a Binary Tree consisting of N nodes, the task is to find the sum of Bitwise AND of the sum of all leaf nodes… Read More

Given a Binary Tree, the task is to find the smallest subtree that contains all the deepest nodes of the given Binary Tree and return… Read More

Given a Binary Tree, the task is to remove the leaf nodes of the Binary Tree during each operation and print the count. Examples: Input: … Read More