## Lowest Common Ancestor in Parent Array Representation

Given a binary tree represented as parent array, find Lowest Common Ancestor between two nodes ‘m’ and ‘n’. In the above diagram, LCA of 10… 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
- Sum of nodes in bottom view of Binary Tree
- Check if two nodes in a Binary Tree are siblings
- Print all leaf nodes of a binary tree from right to left
- Create a mirror tree from the given binary tree
- Print Binary Tree levels in sorted order | Set 3 (Tree given as array)
- K-th ancestor of a node in Binary Tree | Set 3
- Maximum sub-tree sum in a Binary Tree such that the sub-tree is also a BST
- Clockwise Spiral Traversal of Binary Tree | Set - 2
- Check if the given binary tree has a sub-tree with equal no of 1's and 0's | Set 2
- Minimum sum path between two leaves of a binary tree
- Construct Binary Tree from given Parent Array representation | Iterative Approach
- Print leaf nodes in binary tree from left to right using one stack
- Minimum and maximum node that lies in the path connecting two nodes in a Binary Tree
- Iterative approach to check for children sum property in a Binary Tree
- Find the largest Complete Subtree in a given Binary Tree
- Flatten Binary Tree in order of Level Order Traversal
- Count all k-sum paths in a Binary Tree
- Find the kth node in vertical order traversal of a Binary Tree
- Check if the given n-ary tree is a binary tree
- Kth node in Diagonal Traversal of Binary Tree
- Find the largest Perfect Subtree in a given Binary Tree
- Iterative approach to check if a Binary Tree is Perfect
- 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
- Get last node of the binary tree following given pattern starting from X
- Print all the nodes except the leftmost node in every level of the given binary tree

Given a binary tree represented as parent array, find Lowest Common Ancestor between two nodes ‘m’ and ‘n’. In the above diagram, LCA of 10… Read More »

Given two binary trees. The task is to write a program to check if the two trees are identical in structure. In the above figure… Read More »

Given a Binary Tree, find the maximum sum in a binary tree by adding the parent with its children. Exactly three Node needs to be… Read More »

Given a BT and a key Node, find the total sum in BT, except those Node which are adjacent to key Node. Examples: Recommended: Please… Read More »

Round 1: Coding round + MCQs There were 2 coding questions and 20 mcqs of variable marks such as 4, 6 and 2 and no… Read More »

Consider you have an infinitely long binary tree having a pattern as below: 1 / \ 2 3 / \ / \ 4 5 6… Read More »

Given a binary tree and data value of a node. The task is to find the sum of cousin nodes of given node. If given… Read More »

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 »