# Category Archives: Tree (adsbygoogle = window.adsbygoogle || []).push({});

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

## Iterative Method to find Height of Binary Tree

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 »

## Tree Isomorphism Problem

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 »

## Convert a given Binary Tree to Doubly Linked List | Set 1

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 »

## Binary Tree | Set 1 (Introduction)

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 »

## Construct Complete Binary Tree from its Linked List Representation

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 »

## Reverse Level Order Traversal

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 »

## Iterative Postorder Traversal | Set 2 (Using One Stack)

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 »

## Iterative Postorder Traversal | Set 1 (Using Two Stacks)

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 »

## Largest Independent Set Problem | DP-26

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 »

## Segment Tree | Set 2 (Range Minimum Query)

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 »

## Segment Tree | Set 1 (Sum of given range)

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 »

## Linked complete binary tree & its creation

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 »

## Morris traversal for Preorder

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 »

## Amazon Interview | Set 14

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 »