##
Check if all levels of two trees are anagrams or not
July 24, 2017

Given two binary trees, we have to check if each of their levels are anagrams of each other or not. Example: Tree 1: Level 0… Read More »

July 24, 2017

Given two binary trees, we have to check if each of their levels are anagrams of each other or not. Example: Tree 1: Level 0… Read More »

July 22, 2017

In the SET 1 post on TST we have described how to insert and search a node in TST. In this article we will discuss… Read More »

July 17, 2017

Given a perfect binary tree, print nodes of middle level without computing its height. A perfect binary tree is a binary tree in which all… Read More »

Factor Tree is an intuitive method to understand factors of a number. It shows how all the factors are been derived from the number. It… Read More »

Given a binary tree, print all the ancestors of a particular key existing in the tree without using recursion. Here we will be discussing the… Read More »

July 14, 2017

Given a non-empty binary tree, print the average value of the nodes on each level. Examples: Input : 4 / \ 2 9 / \… Read More »

July 13, 2017

Given a binary tree with positive integer values. Find the maximum sum of nodes such that we cannot pick two levels for computing sum Examples:… Read More »

July 10, 2017

Given a rooted tree with N vertices and N-1 edges. We will be given many pairs of vertices u and v, we need to tell… Read More »

Consider a binary tree in which each node has two children except the leaf nodes. If a node is labeled as ‘v’ then its right… Read More »

July 7, 2017

Given a binary tree containing n nodes. The problem is to replace each node in the binary tree with the sum of its inorder predecessor… Read More »

July 4, 2017

Given a binary tree and two nodes, the task is to Print all the nodes that are common for 2 given nodes in a binary… Read More »

June 22, 2017

Given two binary trees. We need to merge them into a new binary tree. The merge rule is that if two nodes overlap, then sum… Read More »

June 19, 2017

Given a binary tree with distinct nodes(no two nodes have the same have data values). The problem is to print the path common to the… Read More »

June 18, 2017

Given a Binary tree, the problem is to find mirror of a given node. The mirror of a node is a node which exist at… Read More »

Given a binary tree with distinct nodes(no two nodes have the same have data values). The problem is to print the path from root to… Read More »