# Category: Binary Tree

## Make a Binary Tree from Given Inorder and Preorder Traveral.

Objective: – Given a inorder and preorder traversal, construct a binary tree from that. Input: Inorder and preorder traversals Similar Problem: Construct a binary tree from given Inorder and Postorder Traversal Approach: int []...

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

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...

## Reverse Alternate levels of a given Binary Tree.

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

## Given a Sorted Singly Linked List Array, Convert it into a Balanced Binary search Tree.

Given a Sorted Array, Convert it into its Balanced Binary search TreeObjective: You have been given a sorted singly List, you need to convert it into balanced binary search tree. Why balanced binary tree...

## Given a binary tree, Convert it into its Mirror Tree

Objective: Given a binary tree, Convert it into its Mirror Tree Mirror Tree: Mirror Tree of a binary tree is where left and right child of every node of given binary tree is interexchanged....

## Given a binary tree, Print All the Nodes that don’t have Siblings.

Objective: Given a binary tree, Print All the Nodes that don’t have siblings. Note: sibling node is the node which has the same parent, so you need to print the nodes who is a...

## Convert a Sorted Doubly Linked List to Balanced BST.

Objective: Given a sorted doubly linked list, convert it into Balanced binary search tree Input: A Doubly Linked List Example: Approach:

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

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

## Print Left View of a given binary tree

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...

## Print Right View of a given binary tree

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

## In a Binary Tree, Check if Two nodes has the same parent or are siblings

Objective: In a Binary Tree, Check if Two nodes has the same parent or are siblings Input: A binary tree and two nodes Example: Approach:

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

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...

## Check if Two BST’s are Identical

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

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

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

## Print All Nodes Between Two Given Levels

Objective: Given a binary Tree and two levels, Print all the nodes between those. Input: A Binary Tree and two levels. Output: Print all the nodes between given levels. Example: