##
Find median in row wise sorted matrix
July 15, 2017

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 »

July 15, 2017

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 »

July 14, 2017

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 »

June 27, 2017

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 »

June 16, 2017

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 »

June 14, 2017

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 »

June 6, 2017

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 »

May 21, 2017

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 »

January 27, 2017

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 »

January 14, 2017

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 »

January 9, 2017

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 »

July 30, 2015

Given an array with all distinct elements, find the largest three elements. Expected time complexity is O(n) and extra space is O(1).

July 16, 2015

Given a Binary Search Tree (BST) and a positive integer k, find the k’th smallest element in the Binary Search Tree.

June 22, 2015

Given an infinite stream of integers, find the k’th largest element at any point of time.

March 19, 2015

Given a Binary Search Tree (BST) and a positive integer k, find the k’th largest element in the Binary Search Tree.

December 1, 2014

We recommend to read following posts as a prerequisite of this post.