We are given a row wise sorted matrix of size r*c, we need to find the median of the matrix given. It is assumed that… Read More »
Given that integers are being read from a data stream. Find median of all the elements read so far starting from the first integer till… Read More »
Given an array of n numbers and a positive integer k. The problem is to find k numbers with most occurrences, i.e., the top k… Read More »
Given a Binary Search Tree, find median of it. If no. of nodes are even: then median = ((n/2th node + (n+1)/2th node) /2 If… Read More »
Given an array of integers, our task is to write a program that efficiently finds the second largest element present in the array. Example: Input… Read More »
We are given an array of size n containing positive integers. The absolute difference between values at indices i and j is |a[i] – a[j]|.… Read More »
Given two integer arrays arr1 and arr2 sorted in ascending order and an integer k. Find k pairs with smallest sums such that one element… Read More »
Given an array of n distinct elements, the task is to find all elements in array which have at-least two greater elements than themselves. Examples:… Read More »
Given Binary Search Tree. The task is to find sum of all elements smaller than and equal to Kth smallest element. Examples: Input : K… Read More »
Given a positive number k and an undirected graph of N nodes, numbered from 0 to N-1, each having a weight associated with it. Note… Read More »
Given an array with all distinct elements, find the largest three elements. Expected time complexity is O(n) and extra space is O(1).
Given a Binary Search Tree (BST) and a positive integer k, find the k’th smallest element in the Binary Search Tree.
Given an infinite stream of integers, find the k’th largest element at any point of time.
Given a Binary Search Tree (BST) and a positive integer k, find the k’th largest element in the Binary Search Tree.
We recommend to read following posts as a prerequisite of this post.