Given an array of integers, replace every element with the least greater element on its right side in the array. If there are no greater… Read More »
Given a Binary Search Tree, convert it into a Min-Heap containing the same elements in O(n) time. Do this in-place. Input: Binary Search Tree 8… Read More »
Inversion Count for an array indicates – how far (or close) the array is from being sorted. If array is already sorted then inversion count… Read More »
Given two Binary Search Trees, find common nodes in them. In other words, find intersection of two BSTs. Example: Recommended: Please solve it on “PRACTICE”… Read More »
Given a Binary Search Tree, write a function that takes following three as arguments: 1) Root of tree 2) Old key value 3) New Key… Read More »
In this article, first count of possible BST (Binary Search Trees)s is discussed, then construction of all possible BSTs. How many structurally unique BSTs for… Read More »
Given a Binary Search Tree (BST) and a positive integer k, find the k’th smallest element in the Binary Search Tree.
Given a Binary Search Tree (BST) of integer values and a range [low, high], return count of nodes where all the nodes under that node… Read More »
Given a Binary Search Tree (BST) and a range, count number of nodes that lie in the given range.
Given a Binary Search Tree(BST), find the second largest element. Examples: Input: Root of below BST 10 / 5 Output: 5 Input: Root of below… Read More »
Design a data structure to do reservations of future jobs on a single machine under following constraints. 1) Every job requires exactly k time units… Read More »
In a Binary Search Tree (BST), all keys in left subtree of a key must be smaller and all keys in right subtree must be… Read More »
Hash Table supports following operations in Θ(1) time.
Given a Binary Search Tree (BST) and a positive integer k, find the k’th largest element in the Binary Search Tree.
Given n appointments, find all conflicting appointments.