## 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 »

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 »

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 »

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 »

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 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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »