##
Averages of Levels in Binary Tree
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 »

Quick Links for Tree

Quizzes |

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 »

June 17, 2017

Given a height h, count and return the maximum number of balanced binary trees possible with height h. A balanced binary tree is one in… Read More »

June 13, 2017

It is recommended to refer following post as prerequisite of this post. Splay Tree | Set 1 (Search) Following are the different cases to delete… Read More »

June 12, 2017

Given two binary tress. The problem is to check whether the two binary tress are mirrors of each other or not. Mirror of a Binary… Read More »

Quadtrees are trees used to efficiently store data of points on a two-dimensional space. In this tree, each node has at most four children. We… Read More »

June 11, 2017

Left-Child Right-Sibling Representation is a different representation of an n-ary tree where instead of holding a reference to each and every child node, a node… Read More »