Skip to content

Tag Archives: median-finding

Prerequisite: Tree Traversals (Inorder, Preorder and Postorder), MedianGiven a Binary tree having integral nodes, the task is to find the median for each position in… Read More
Given an array arr[] of positive integers of even length, the task is to partition these elements of arr[] into two groups each of odd… Read More
Given an unsorted array arr[] of length N, the task is to find the median of this array. Median of a sorted array of size N… Read More
Given an array of integer arr[] and an integer k, the task is to find the median of each window of size k starting from… Read More
Given a sequence A1, A2, A3, … An of distinct integers. The task is to find the last 2 remaining elements after removing the median… 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, the… 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 a sorted… Read More
What is a Median? The Median is the middle value of a set of data. To determine the median value in a sequence of numbers,… 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 operations… 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[], the task is to find the median of these sorted arrays, in O(log(min(n, m)), when n is the… Read More

Start Your Coding Journey Now!