Tutorials
Courses
Go Premium
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
32.1K+ articles
DSA
20.0K+ articles
Misc
7.8K+ articles
Mathematical
5.1K+ articles
Arrays
4.2K+ articles
Greedy
1.4K+ articles
Sorting
1.1K+ articles
Binary Search
530+ articles
Order-Statistics
65+ articles
statistical-algorithms
50+ articles
median-finding
67 posts
Recent Articles
Popular Articles
Minimize Sum of Distance in 2D Plane
Last Updated: 23 July 2025
Given N points in the 2D plane such that each point has a weight Wi. The task is to find a point K such that the sum of the total distance between point K and each point i...
read more
Sorting
Mathematical
DSA
median-finding
Construct two arrays satisfying the given conditions
Last Updated: 23 July 2025
Given an integer N (N ? 2), the task is to find the maximum median that can be created by forming optimal sum pairs from X[] and Y[] such that these arrays should follow t...
read more
Technical Scripter
Technical Scripter 2022
DSA
median-finding
Median of ancestors for each Node of a given tree
Last Updated: 03 April 2023
Given a tree with N vertices from 0 to N - 1 (0th node is root) and val[] where val[i] denotes the value of the ith vertex, the task is to find the array of integers ans[]...
read more
Tree
Technical Scripter
Technical Scripter 2022
DSA
median-finding
Maximize median of Array formed by adding elements of two other Arrays
Last Updated: 23 July 2025
Given two arrays x[] and y[] of N integers, the task is to form an array z[] of x[i] + y[j], (0 ?i, j N) and find the max value of median of z[] formed by optimal rearran...
read more
Sorting
DSA
Arrays
median-finding
Minimize increment or decrement operations to make given Array elements consecutive
Last Updated: 23 July 2025
Given an array, arr[] of size N., The task is to perform minimum increment or decrement operations on the elements of the array, to make all the elements consecutive, Outp...
read more
Sorting
Mathematical
DSA
Arrays
median-finding
C++ Program to Find median in row wise sorted matrix
Last Updated: 23 July 2025
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 r*c is always odd.Examples: Input : 1 3 5 2 6 ...
read more
C++
Order-Statistics
Binary Search
statistical-algorithms
median-finding
Java Program to Find median in row wise sorted matrix
Last Updated: 23 July 2025
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 r*c is always odd.Examples: Input : 1 3 5 2 6 ...
read more
Java
Order-Statistics
Binary Search
statistical-algorithms
median-finding
Python Program to Find median in row wise sorted matrix
Last Updated: 23 July 2025
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 r*c is always odd.Examples:Input : 1 3 5 2 6 9...
read more
Python
Order-Statistics
Binary Search
statistical-algorithms
median-finding
Javascript Program to Find median in row wise sorted matrix
Last Updated: 23 July 2025
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 r*c is always odd.Examples:Input : 1 3 5 2 6 9...
read more
JavaScript
Order-Statistics
Binary Search
statistical-algorithms
median-finding
Maximise count of elements that are strictly greater in a subsequence than their average
Last Updated: 23 July 2025
Given an array arr[] of size N containing positive integers, the task is to find the maximum number of elements that can be deleted from the array using any number of oper...
read more
Searching
DSA
Arrays
subsequence
median-finding
Find largest median of a sub array with length at least K
Last Updated: 23 July 2025
Given an array arr[] of length N (1= arr[i] = N) and an integer K. The task is to find the largest median of any subarray in arr[] of at least K size.Examples:Input: arr[]...
read more
DSA
Binary Search
subarray
median-finding
Maximum median possible by generating an Array of size N with sum X
Last Updated: 23 July 2025
Given two positive integers N and X. The task is to print the maximum median possible by generating an Array of size N with sum XExamples:Input: N = 1, X = 7Output: 7Expla...
read more
Greedy
Mathematical
DSA
median-finding
Find the sum of medians of all odd length subarrays
Last Updated: 23 July 2025
Given an array arr[] of size N, the task is to find the sum of medians of all sub-array of odd-length.Examples:Input: arr[] = {4, 2, 5, 1}Output: 18Explanation : Sub-Array...
read more
Sorting
Mathematical
Heap
DSA
Arrays
subarray
median-finding
Minimize value of x that minimizes value of |a1−x|^c+|a2−x|^c+···+|an−x|^c for value of c as 1 and 2
Last Updated: 23 July 2025
Given an array arr[] of N elements, the task is to find the value of x that minimizes the value of expression for c = 1.|a1−x|c+|a2−x|c+···+|an−x|c = |a1−x|+|a2−x|+···+|an...
read more
DSA
median-finding
Find Median for each Array element by excluding the index at which Median is calculated
Last Updated: 23 July 2025
Given an array A[] of N integers where N is even, . the task is to generate an array of medians where the median of the array is calculated by taking the median of array A...
read more
Sorting
Mathematical
DSA
Arrays
median-finding
1
2
3
4
5
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !