## Construct Tree from given Inorder and Preorder traversals

Let us consider the below traversals: Inorder sequence: D B E A F C Preorder sequence: A B D E C F Recommended: Please solve… Read More »

- MakeMyTrip Interview Experience 2019
- Iterative Method To Print Left View of a Binary Tree
- Count the Number of Binary Search Trees present in a Binary Tree
- Flatten a binary tree into linked list | Set-3
- Zig-Zag traversal of a Binary Tree using Recursion
- Difference between graph and tree
- Remove minimum elements from either side such that 2*min becomes more than max | Set 2
- Shortest root to leaf path sum equal to a given number
- Clockwise Spiral Traversal of Binary Tree
- Reverse zigzag Traversal of a Binary Tree
- Check if given Preorder, Inorder and Postorder traversals are of same tree | Set 2
- Iterative Boundary traversal of Complete Binary tree
- Number of subarrays have bitwise OR >= K
- Sum of nodes at maximum depth of a Binary Tree | Set 2
- Reverse Level Order traversal in spiral form
- Check if the given Binary Tree have a Subtree with equal no of 1's and 0's
- Print All Leaf Nodes of a Binary Tree from left to right | Set-2 ( Iterative Approach )
- Find the number of distinct pairs of vertices which have a distance of exactly k in a tree
- DP on Trees | Set-3 ( Diameter of N-ary Tree )
- Spanning Tree With Maximum Degree (Using Kruskal's Algorithm)
- Sum of all the Boundary Nodes of a Binary Tree
- Sum of nodes in bottom view of Binary Tree
- Determine the count of Leaf nodes in an N-ary tree
- Distribute candies in a Binary Tree
- Check if the given binary tree has a sub-tree with equal no of 1's and 0's | Set 2
- LCA in a tree using Binary Lifting Technique
- Maximum number of leaf nodes that can be visited within the given budget
- Print all leaf nodes of a binary tree from right to left
- Print Binary Tree levels in sorted order | Set 3 (Tree given as array)
- Adobe Interview Experience ( 3 Years Exp )

Let us consider the below traversals: Inorder sequence: D B E A F C Preorder sequence: A B D E C F Recommended: Please solve… Read More »

Given a binary tree and a number, return true if the tree has a root-to-leaf path such that adding up all the values along the… Read More »

Using Morris Traversal, we can traverse the tree without using stack and recursion. The idea of Morris Traversal is based on Threaded Binary Tree. In… Read More »

Using Stack is the obvious way to traverse tree without recursion. Below is an algorithm for traversing binary tree using stack. See this for step… Read More »

A tree where no leaf is much farther away from the root than any other leaf. Different balancing schemes allow different definitions of “much farther”… Read More »

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

Question: Given an arbitrary binary tree, convert it to a binary tree that holds Children Sum Property. You can only increment data values in any… Read More »

Given a binary tree, write a function that returns true if the tree satisfies below property. For every node, data value must be equal to… Read More »

Write a function to print spiral order traversal of a tree. For below tree, function should print 1, 2, 3, 4, 5, 6, 7. Recommended:… Read More »

A binary search tree (BST) is a node based binary tree data structure which has the following properties. • The left subtree of a node… Read More »

A node is a leaf node if both left and right child nodes of it are NULL. Here is an algorithm to get the leaf… Read More »

Level order traversal of a tree is breadth first traversal for the tree. Level order traversal of the above tree is 1 2 3 4… Read More »

This is quite simple. Just traverse the node from root to left recursively until left is NULL. The node whose left is NULL is the… Read More »

Asked by Varun Bhatia. Question: Write a recursive function treeToList(Node root) that takes an ordered binary tree and rearranges the internal pointers to make a… Read More »

Given values of two values n1 and n2 in a Binary Search Tree, find the Lowest Common Ancestor (LCA). You may assume that both the… Read More »