## Remove edges connected to a node such that the three given nodes are in different trees

Given a binary tree and 3 nodes a, b and c, the task is to find a node in the tree such that after removing… Read More »

## Level order traversal with direction change after every two levels | Recursive Approach

Given a binary tree, print the level order traversal in such a way that first two levels are printed from left to right, next two… Read More »

## Sum of nodes at maximum depth of a Binary Tree | Iterative Approach

Given a root node to a tree, find the sum of all the leaf nodes which are at maximum depth from root node. Example: 1… Read More »

## Flatten a binary tree into linked list

Given a binary tree, flatten it into linked list in-place. Usage of auxiliary data structure is not allowed. After flattening, left of each node should… Read More »

## Check if two nodes are cousins in a Binary Tree | Set-2

Given a binary tree and the two nodes say ‘a’ and ‘b’, determine whether two given nodes are cousins of each other or not. Two… Read More »

## Check if two trees are mirror of each other using level order traversal

Given two binary trees, the task is to check whether the two binary trees is a mirror of each other or not. Mirror of a… Read More »

## Check if a binary tree is sorted level-wise or not

Given a binary tree. The task is to check if the binary tree is sorted level-wise or not. A binary tree is level sorted if… Read More »

## Find n-th node in Postorder traversal of a Binary Tree

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

## 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 »

## Find n-th node in Preorder traversal of a Binary Tree

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 »

## Queries to find distance between two nodes of a Binary tree – O(logn) method

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 »

## Preorder predecessor of a Node in Binary Tree

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 »

## Preorder Successor of a Node in Binary Tree

Given a binary tree and a node in the binary tree, find preorder successor of the given node. It may be assumed that every node… Read More »

## Queries to find distance between two nodes of a Binary tree

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 »

## Euler tour of Binary Tree

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 »