## Custom Tree Problem

You are given a set of links, e.g. a —> b b —> c b —> d a —> e Print the tree that would… Read More »

- Check if given Preorder, Inorder and Postorder traversals are of same tree | Set 2
- Kth smallest element in a subarray
- Introduction to Data Structures | 10 most commonly used Data Structures
- Iterative Postorder traversal | Set 3
- Total number of possible Binary Search Trees using Catalan Number
- Adobe Interview Experience ( 3 Years Exp )
- LCA in a tree using Binary Lifting Technique
- Convert a given Binary Tree to Circular Doubly Linked List | Set 2
- Spanning Tree With Maximum Degree (Using Kruskal's Algorithm)
- Find the node with maximum value in a Binary Search Tree using recursion
- Print all leaf nodes of a binary tree from right to left
- Create a mirror tree from the given binary tree
- K-th ancestor of a node in Binary Tree | Set 3
- Print path from root to all nodes in a Complete Binary Tree
- Lazy Propagation in Segment Tree | Set 2
- Pair with a given sum in BST | Set 2
- Burn the binary tree starting from the target node
- Check which player visits more number of Nodes
- Find the node with minimum value in a Binary Search Tree using recursion
- Maximum sub-tree sum in a Binary Tree such that the sub-tree is also a BST
- Construct BST from its given level order traversal | Set-2
- Minimum steps to color the tree with given colors
- Check if the given binary tree has a sub-tree with equal no of 1's and 0's | Set 2
- Sum of the distances from every node to all other nodes is maximum
- Number of pairs with a given sum in a Binary Search Tree
- Calculate height of Binary Tree using Inorder and Level Order Traversal
- Construct Binary Tree from given Parent Array representation | Iterative Approach
- Print Binary Search Tree in Min Max Fashion
- Find the largest Complete Subtree in a given Binary Tree
- Reverse tree path using Queue

You are given a set of links, e.g. a —> b b —> c b —> d a —> e Print the tree that would… Read More »

There are two conventions to define the height of a Binary Tree 1) Number of nodes on the longest path from the root to the… Read More »

Write a function to detect if two trees are isomorphic. Two trees are called isomorphic if one of them can be obtained from other by… Read More »

Given a Binary Tree (Bt), convert it to a Doubly Linked List(DLL). The left and right pointers in nodes are to be used as previous… Read More »

Trees: Unlike Arrays, Linked Lists, Stack and queues, which are linear data structures, trees are hierarchical data structures. Tree Vocabulary: The topmost node is called… Read More »

Given Linked List Representation of Complete Binary Tree, construct the Binary tree. A complete binary tree can be represented in an array in the following… Read More »

We have discussed level order traversal of a post in previous post. The idea is to print last level first, then second last level, and… Read More »

We have discussed a simple iterative postorder traversal using two stacks in the previous post. In this post, an approach with only one stack is… Read More »

We have discussed iterative inorder and iterative preorder traversals. In this post, iterative postorder traversal is discussed, which is more complex than the other two… Read More »

Given a Binary Tree, find size of the Largest Independent Set(LIS) in it. A subset of all tree nodes is an independent set if there… Read More »

We have introduced segment tree with a simple example in the previous post. In this post, Range Minimum Query problem is discussed as another example… Read More »

Let us consider the following problem to understand Segment Trees. We have an array arr[0 . . . n-1]. We should be able to 1… Read More »

A complete binary tree is a binary tree where each level ‘l’ except the last has 2^l nodes and the nodes at the last level… Read More »

Using Morris Traversal, we can traverse the tree without using stack and recursion. The algorithm for Preorder is almost similar to Morris traversal for Inorder.… Read More »

Team : Transportation Location :Hyderabad Round 1 (Online Test) Q1. Find the kth largest value in a BST Q2. Swap the alternate nodes in a singly linked… Read More »