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

@tutorialhorizon

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

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

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:

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 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 an array of intergers, sort it such that the odd numbers appear first followed by the even numbers . The odd numbers in ascending order and the even numbers in descending order....

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:

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

Objective: Given a sorted(ascending order) arrays of integers, find out the number of occurences of a number in that array Input: A sorted array arrA[] and a number x. Output: number of occurrences of...

Objective: Given an array of integers, find out the first repeated element. First repeated element means the element occurs atleast twice and has smallest index. Input: An Array Output: The first repeated element Examples...

Objective: Given a Binary tree, find out whether its binary search tree or not. Input: A Binary Tree. Output: True or false based on whether tree is BST ot not. Approach: Method 1 :...

Objective: Given two binary trees, check if one binary tree is a subtree of another Input: Two binary trees Output: True or false based on whether one tree is subtree of another Example :...

%d bloggers like this: