## k smallest elements in same order using O(1) extra space

You are given an array of n-elements you have to find k smallest elements from the array but they must be in the same order… Read More »

## Find the k most frequent words from data set in Python

Given the data set, we can find k number of most frequent words. The solution of this problem already present as Find the k most… Read More »

## Minimum number of elements to add to make median equals x

A median in an array with the length of n is an element which occupies position number (n+1)/2 after we sort the elements in the… Read More »

## Quickselect Algorithm

Quickselect is a selection algorithm to find the k-th smallest element in an unordered list. It is related to the quick sort sorting algorithm. Examples:… Read More »

## Mean and Median of a matrix

Given a sorted matrix of size n*n. Calculate the mean and median of the matrix . Examples: Input : 1 2 3 4 5 6… Read More »

## Program for Mean and median of an unsorted array

Given n size unsorted array, find its mean and median. Mean of an array = (sum of all elements) / (number of elements) Median of… Read More »

## Minimum product of k integers in an array of positive Integers

Given an array of n positive integers. We are required to write a program to print the minimum product of k integers of the given… Read More »

## K-th Largest Sum Contiguous Subarray

Given an array of integers. Write a program to find the K-th largest sum of contiguous subarray within the array of numbers which has negative… Read More »

## Maximum difference between group of k-elements and rest of the array.

You are given an array of n elements. You have to divide the given array into two group such that one group consists exactly k… Read More »

## M-th smallest number having k number of set bits.

Given two non-negative integers m and k. The problem is to find the m-th smallest number having k number of set bits. Constraints: 1 <=… Read More »

## Order statistic tree using fenwick tree (BIT)

Given an array of integers with limited range (0 to 1000000). We need to implement an Order statistic tree using fenwick tree. It should support… Read More »

## K’th Smallest/Largest Element using STL

Given an array and a number k where k is smaller than size of array, we need to find the k’th smallest element in the… Read More »

## Find top k (or most frequent) numbers in a stream

Given an array of n numbers. Your task is to read numbers from the array and keep at-most K numbers at the top (According to… Read More »

## Find median in row wise sorted matrix

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 »

## Median of Stream of Running Integers using STL

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 »