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

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

Skip to content
# Category: Top Companies

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

##
Sort an Array 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.

##
Find the maximum width of a binary tree

##
Find the number of occurrences of a number in a given sorted array.

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

##
Find the first repeated element in an array by its index

##
Minimum number that cannot be formed by any subset of an array

##
Determine whether given binary tree is binary search tree(BST) or not

##
Given two binary trees, check if one binary tree is a subtree of another

##
Print a path from Root to Node in Binary Tree

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

##
Inorder Successor in Binary Search Tree Using Parent link

##
Inorder Successor in Binary Tree

##
Sorted Array to Binary Search Tree of Minimal Height

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

@tutorialhorizon

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, 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 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 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 sorted array of positive integers, find out the smallest integer which cannot be represented as the sum of any subset of the array Input: A Sorted Array Output: The smallest number...

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

Objective: Given a Binary tree (Not binary Search Tree ), Print a path from root to a given node. Input: A binary tree, a node x Output: Path from root to a given node...

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

Algorithms – Inorder Successor in Binary Tree Objective: Given a Binary tree (Not binary Search Tree ), find the inorder successor of a node. What is Inorder Successor: Inorder successor of a node is...

Objective: Given a sorted array with unique elements, Create a binary search tree with minimal height. Why minimal height is important : We can do the linear scan to the array and make the...

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

%d bloggers like this: