# Tag Archives: median-finding

## Median of all non-empty subset sums

Given an array, arr[] of size N, the task is to find the median of sums of all possible subsets of the given array. Examples:… Read More »

## Minimum jumps required to make a group of persons sit together

Given a string S of length N consisting of ‘x’ and ‘.’. The given string represents a row of seats where ‘x’ and ‘.’ represent… Read More »

## Print X array elements closest to the Kth smallest element in the array

Given two integers K, X, and an array arr[] consisting of N distinct elements, the task is to find X elements closest to the Kth… Read More »

## Program to find weighted median of a given array

Given two arrays arr[] of N integers and W[] of N weights where W[i] is the weight for the element arr[i]. The task is to… Read More »

## Minimum Sum of Euclidean Distances to all given Points

Given a matrix mat[][] consisting of N pairs of the form {x, y} each denoting coordinates of N points, the task is to find the… Read More »

## Median of difference of all pairs from an Array

Given an array arr[] of length N, the task is to find the median of the differences of all pairs of the array elements. Example:… Read More »

## Find the point on X-axis from given N points having least Sum of Distances from all other points

Given an array arr[] consisting of N integers, denoting N points lying on the X-axis, the task is to find the point which has the… Read More »

## Minimum cost required to convert all Subarrays of size K to a single element

Prerequisite: Sliding Window Median Given an array arr[] consisting of N integers and an integer K, the task is to find the minimum cost required… Read More »

## Count of Array elements greater than or equal to twice the Median of K trailing Array elements

Given an array A[] of size greater than integer K, the task is to find the total number of elements from the array which are… Read More »

## Maximize median after doing K addition operation on the Array

Given an array arr[] of N elements and an integer K, the task is to perform at most K operation on the array. In the… Read More »

## Kth Smallest element in a Perfect Binary Search Tree

Given a Perfect BST with N nodes and an integer K, the task is to find the Kth smallest element is present in the tree.… Read More »

## Median of sliding window in an array | Set 2

Prerequisites: Policy based data structure, Sliding window technique. Given an array of integer arr[] and an integer K, the task is to find the median… Read More »

## Minimum increment/decrement operations required to make Median as X

Given an array A[] of n odd integers and an integer X. Calculate the minimum number of operations required to make the median of the… Read More »

## Area of a Triangle from the given lengths of medians

Given three integers A,B and C which denotes length of the three medians of a triangle, the task is to calculate the area of the… Read More »

## Change in Median of given array after deleting given elements

Given two arrays arr1[] and arr2[]. The array arr1[] is sorted. The task is to print the change in the median after removing each element… Read More »