Given an N-ary tree root, the task is to find the count of nodes such that their subtree is a binary tree. Example: Input: Tree… Read More

# Tag Archives: PostOrder Traversal

Given an N-ary tree root and a list of K nodes, the task is to find the number of common ancestors of the given K… Read More

Given a binary tree consisting of N nodes, the task is to split the binary tree into two subtrees by removing one edge such that… Read More

Given a Binary tree, the task is to trim this tree for any subtree containing only 0s. Examples: Input: 1 \ 0 / \ 0… 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

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 print all the nodes of the binary tree in Pre-order, Post-order, and In-order iteratively using only one… Read More

Given a Binary Tree, the task is to find the sum of all such nodes from the given tree whose sum of left and right… Read More

Given a Binary Tree and an integer K, the task is to delete nodes from the given Tree such that the sum of all nodes… Read More

Given a Binary Tree, the task is for each level is to print the total number of nodes from all lower levels which are less… Read More

Given a Binary Tree, the task is to find the node from the given tree which has the maximum number of nodes in its subtree… Read More

Given a binary tree and an integer K, the task is to count the possible pairs of leaf nodes from the given binary tree such… Read More

Given a Binary Tree, the task is to find the length of the longest straight path of the given binary tree. Straight Path is defined… Read More

Given a Binary Tree and an array arr[] consisting of values of nodes to be deleted, the task is to print Inorder Traversal of the… Read More

Given a Tree with N nodes values from 1 to N and N – 1 edges. The task is to find the maximum matching in… Read More