Skip to content

Category Archives: Tree

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
Given a Generic Tree consisting of N nodes (rooted at 0) where each node is associated with a value, the task for each level of… Read More
AVL Tree: It is a self-balancing Binary Search Tree where the Balance Factor cannot be more than one for all nodes. Balance Factor can be… 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 consisting of N nodes, the task is to count the number of levels in a Binary Tree such that the set… Read More