## Deleting a binary tree using the delete keyword

A recursive and a non-recursive program to delete an entire binary tree has already been discussed in the previous posts. In this post, deleting the… Read More »

- Check if given Preorder, Inorder and Postorder traversals are of same tree | Set 2
- Iterative Postorder traversal | Set 3
- Convert a given Binary Tree to Circular Doubly Linked List | Set 2
- LCA in a tree using Binary Lifting Technique
- Print all leaf nodes of a binary tree from right to left
- K-th ancestor of a node in Binary Tree | Set 3
- Calculate height of Binary Tree using Inorder and Level Order Traversal
- Flatten Binary Tree in order of Level Order Traversal
- Find the largest Complete Subtree in a given Binary Tree
- Iterative approach to check for children sum property in a Binary Tree
- Count all k-sum paths in a Binary Tree
- Find the kth node in vertical order traversal of a Binary Tree
- Kth node in Diagonal Traversal of Binary Tree
- Check if the given n-ary tree is a binary tree
- Find the Deepest Node in a Binary Tree Using Queue STL - SET 2
- Find the largest Perfect Subtree in a given Binary Tree
- Iterative approach to check if a Binary Tree is Perfect
- Get last node of the binary tree following given pattern starting from X
- Sum of the mirror image nodes of a complete binary tree in an inorder way
- Reverse alternate levels of a perfect binary tree using Stack
- Print all the nodes except the leftmost node in every level of the given binary tree
- Maximum sum of leaf nodes among all levels of the given binary tree
- Find the sum of leafs at maximum level
- Recursive Program to Print extreme nodes of each level of Binary Tree in alternate order
- Reverse Clockwise spiral traversal of a binary tree
- Print even positioned nodes of even levels in level order of the given binary tree
- Flatten binary tree in order of post-order traversal
- Connect all nodes to their Left Neighbors in a Binary Tree
- Find the node whose xor with x gives minimum value
- Convert ternary expression to Binary Tree using Stack

A recursive and a non-recursive program to delete an entire binary tree has already been discussed in the previous posts. In this post, deleting the… Read More »

Given a binary tree and a node, print all cousins of given node. Note that siblings should not be printed. Examples: Input : root of… Read More »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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. It may be assumed that every node… Read More »