## 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# Tagged: Expert

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

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

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

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

## Print All The Permutations Of a String

## Level Order Traversal in Zig Zag pattern OR Print in Spiral Pattern

## Inorder Successor in Binary Search Tree without Using Parent link

## Inorder Successor in Binary Search Tree Using Parent link

## In a Binary Tree, Create Linked Lists of all the nodes at each depth.

## Rearrange Positive and Negative Numbers of Array On Each Side in O(nlogn)

@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: – 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: – 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 []...

Objective: Given a String, print all the permutations of it. Input: A String Output: Print all the permutations of a string Example: Input : abc Output: abc acb bac bca cba cab Approach:

Objective: Given a binary Tree, Do Level Order Traversal in Zig Zag pattern OR Print in Spiral Input: A Binary Tree Output: Order Traversal in Zig Zag pattern OR Print in Spiral.

Objective: Given a Binary Search tree, find the inorder successor of a node. What is Inorder Successor: Inorder successor of a node is the next node in the inorder traversal of the tree. For...

Algorithms – Inorder Successor in Binary Search Tree Using Parent link Objective: Given a Binary Search tree in which every node has a link to its parent, find the inorder successor of a node....

Objective: Given a Binary tree create Linked Lists of all the nodes at each depth , say if the tree has height k then create k linked lists. NOTE : This problem is very...

Objective: Rearrange Positive and Negative Numbers of an Array so that one side you have positive numbers and other side with negative Integers without changing their respective order. Example : Input : 1 -2...

%d bloggers like this: