Skip to content

Category Archives: Tree

Given a Binary Tree consisting of N nodes and a integer K, the task is to find the depth and height of the node with… Read More
Given an infinite complete binary tree rooted at node 1, where every ith node has two children, with values 2 * i and 2 *… Read More
Basically, an N-array tree is such a tree structure in which each node can have a max of up to ‘N’ number of children. The… Read More
Given a Binary Tree consisting of N nodes, valued from 1 to N, rooted at node 1, the task is for each node is to… Read More
Given a Binary Tree consisting only ‘(‘ and ‘)’ a level is considered to be balanced if the nodes of the level having parenthesis are… Read More
Given an N-ary Tree consisting of N nodes valued from [1, N], where node 1 is the root, the task is to count the pairs… Read More
Given a Binary Tree consisting of N nodes, the task is to replace all the nodes that are present at even-numbered levels in a Binary… 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 nodes with values 0 and 1 only, the task is to find the total sum of the decimal equivalents… Read More
Given a binary tree consisting of N nodes, the task is to check if the nodes in the top view of a Binary Tree forms… 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 remove all the subtrees that do not contain any odd valued node. Print the Levelorder Traversal of… Read More
Given a binary tree consisting of either 1 or 0 as its node values, the task is to find the sum of all vertical levels… Read More
Given two arrays Node_ID[] and Parent_ID[]., construct a binary tree where value of ith node is equal to Node_ID[i] and parent of ith node is… Read More
Given a Binary Tree with each node representing an alphabet, the task is to find lexicographically smallest palindromic root to leaf path. If no palindromic… Read More