## Array element with minimum sum of absolute differences

Given an array arr[] of N integers, the task is to find an element x from the array such that |arr[0] – x| + |arr[1]… Read More »

## Geometric Median

In normal median, we find a point that has minimum sum of distances. Similar concept applies in 2-D space. Given N points in 2-D space,… Read More »

## Minimum operations of given type to make all elements of a matrix equal

Given an integer K and a matrix of N rows and M columns, the task is to find the minimum number of operations required to… Read More »

## Finding Median in a Sorted Linked List

Given A sorted linked list of elements. The task is to find the median in the given Sorted Linked List. We know that median in… Read More »

## Median

Median is the middle value of a set of data. To determine the median value in a sequence of numbers, the numbers must first be… Read More »

## Maximize the median of an array

Given an array of n elements. The task is to print the array in a form such that the median of that array is maximum.… Read More »

## Minimum Increment / decrement to make array elements equal

Given an array of integers where . In one operation you can either Increment/Decrement any element by 1. The task is to find the minimum… Read More »

## Minimum sum of differences with an element in an array

Given an array, we need to find the sum of elements of an array after changing the element as arr[i] will become abs(arr[i]-x) where x… Read More »

## Median of two sorted arrays of different sizes | Set 1 (Linear)

This is an extension of the median of two sorted arrays of equal size problem. Here we handle arrays of unequal size also. Examples: Input… Read More »

## Median of two sorted arrays with different sizes in O(log(min(n, m)))

Given two sorted arrays, a[] and b[], task is to find the median of these sorted arrays, in O(log(min(n, m)), when n is the number… Read More »

## Median and Mode using Counting Sort

Given an n sized unsorted array, find median and mode using counting sort technique. Thia can be useful when array elements are in limited range.… 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 »

## Decode a median string to the original string

Given a string s written in median form, change it back to the original string. Median letter in a string is the letter which is… Read More »

## Median after K additional integers

Given an array of n integers. We are allowed to add k additional integer in the array and then find the median of the resultant… 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 »