## Convert a Binary Tree such that every node stores the sum of all nodes in its right subtree

Given a binary tree, change the value in each node to sum of all the values in the nodes in the right subtree including its… Read More »

Given a binary tree, change the value in each node to sum of all the values in the nodes in the right subtree including its… Read More »

Given a Binary tree and a number N, write a program to find the N-th node in the Preorder traversal of the given Binary tree.… Read More »

Given a binary tree, the task is to find the distance between two keys in a binary tree, no parent pointers are given. Distance between… Read More »

Given a binary tree and a node in the binary tree, find Preorder predecessor of the given node. Examples: Consider the following binary tree 20… Read More »

Given a binary tree and a node in the binary tree, find preorder successor of the given node. Examples: Consider the following binary tree 20… Read More »

Given a binary tree, the task is to find the distance between two keys in a binary tree, no parent pointers are given. The distance… Read More »

Given a binary tree where each node can have at most two child nodes, the task is to find the Euler tour of the binary… Read More »

The diameter of a tree (sometimes called the width) is the number of nodes on the longest path between two end nodes. In this post,… Read More »

Given a binary tree. Find if a given vertical level of the binary tree is sorted or not. (For the case when two nodes are… Read More »

Given a binary tree, find the vertical width of the binary tree. Width of a binary tree is the number of vertical paths. Examples: Input… Read More »

Given a binary tree, find the vertical width of the binary tree. Width of a binary tree is the number of vertical paths. In this… Read More »

Given a binary tree in which nodes are numbered from 1 to n. Given a node and a positive integer K. We have to print… Read More »

Given a binary tree and a node, we need to write a program to find inorder successor of this node. Inorder Successor of a node… Read More »

Given Preorder , Inorder and Postorder traversals of some tree. Write a program to check if they all are of the same tree. Examples: Input… Read More »

Given a binary tree, find the sum of all the leaf nodes. Examples: Input : 1 / \ 2 3 / \ / \ 4… Read More »