## Find the Distance between Two Nodes of a Binary Tree.

Objective: – Given nodes in a binary tree, find the distance between them. Example : Approach:

Skip to content# Category: Amazon Questions

## Find the Distance between Two Nodes of a Binary Tree.

## Construct a binary tree from given Inorder and Postorder Traversal

## Print the Vertical Sum in binary Tree .

## Print the Binary Tree in Vertical Order Path.

## Lowest Common Ancestor in a Binary Tree (Not Binary Search Tree).

## Lowest Common Ancestor in a Binary Search Tree.

## Given a binary tree, find out the maximum sum of value from root to each leaf.

## Reverse Alternate levels of a given Binary Tree.

## Given a binary tree, Find the Maximum Path Sum between Any Two Leaves

## Print Left View of a given binary tree

## In a Binary Tree, Check if two nodes are Cousins

## Check if Two BST’s are Identical

## Print Paths from root to all leaf nodes in a binary tree.

## Sort an Given Array in the order defined by another array

## Find the maximum width of a binary tree

@tutorialhorizon

Objective: – Given nodes in a binary tree, find the distance between them. Example : Approach:

Objective: – Given a inorder and postorder traversal, write an algorithm to construct a binary tree from that. This problem was asked in the Microsoft coding competition. Input: Inorder and postorder traversals Similar Problems:...

Objective: – Given a binary tree, print it in vertical order sum What is Vertical Order Sum as you can see in the example above, [4],[2], [12],[3],[7] are the vertical order sum of the...

Objective: – Given a binary tree, print it in vertical order path. What is Vertical Order as you can see in the example above, [4],[2], [1,5,6],[3],[7] are the verical order of the given binary...

Objective: – Find the Lowest Common Ancestor of two given nodes in a Binary Tree What is Lowest Common Ancestor In a given binary tree, The lowest common ancestor of two nodes n1 and...

Objective: – Find the Lowest Common Ancestor of two given nodes in a Binary Search Tree What is Lowest Common Ancestor In a given binary tree, The lowest common ancestor of two nodes n1...

Objective: – Find the maximum sum leaf to root path in a Binary Tree. Means in all the paths from root to leaves, find the path which has the maximum sum. Input: A binary...

Objective: – Reverse Alternate levels of a given binary tree Input: A binary tree Example: Appraoch:

Objective: Given a binary tree, Find the maximum path sum from one leaf node to another. Input: A binary tree. Example: Approach:

Objective: In a Binary Tree, print left view of it Input: A binary tree. What is left View of a binary Tree When just look at the tree from the left side , all...

Objective: Given a binary tree and two nodes, Check if they are cousins Input: A binary tree and two nodes Cousin Nodes: Cousin nodes are the nodes who are at the same level in...

Objective: Given Two binary Search Trees, Check if both are identical. Input: Two binary Search Trees Approach:

Objective: Given a binary tree, Print paths from root to all leaf nodes Input: A binary tree Example: Approach:

Objective: Given an array of integers, write an algorithm to sort it according to the order defined by another array. Input: An Array of Integers Example: Input Array : 2 6 9 1 4...

Objective: Given a binary Tree, write an algorithm to find the maximum width. Note: Maximum width of a tree is nothing but the Max(nodes at each level). Input: A Binary Tree Output: Maximum width...

%d bloggers like this: