## Given an array arrA[], find the maximum j – i such that arr[j] > arr[i].

Objective: Given an array arrA[], find the maximum j – i such that arr[j] > arr[i]. Example: int[] arrA = { 12, 3, 1, 5, 6, 4, 10, 9, 8, 0 }; Output: Max(j-i)...

@tutorialhorizon

Objective: Given an array arrA[], find the maximum j – i such that arr[j] > arr[i]. Example: int[] arrA = { 12, 3, 1, 5, 6, 4, 10, 9, 8, 0 }; Output: Max(j-i)...

Objective: Given an array of size of N and number k. Find all elements in an Array which appears more than N/K times. Input: Array [] and number k. Example: int[] arrA = {...

Objective: – Given Binary Tree, Print All The Nodes Which are X distance from the Given Node. Example : Approach: Quite Tricky solution, i will explain using the example given in the picture.

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

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: – 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 sorted doubly linked list, convert it into Balanced binary search tree Input: A Doubly Linked List Example: Approach:

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 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 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: Given a Binary tree , Print each level of a tree in separate line. NOTE : This problem is very similar ” Create Linked Lists of all the nodes at each depth “...

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: