Courses
Tutorials
Practice
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
37.4K+ articles
DSA
22.8K+ articles
Mathematical
7.8K+ articles
Arrays
6.5K+ articles
Competitive Programming
3.3K+ articles
Greedy
2.1K+ articles
Algorithms
2.0K+ articles
Sorting
1.8K+ articles
Searching
1.7K+ articles
statistical-algorithms
50+ articles
median-finding
67 posts
Recent Articles
Popular Articles
Minimize Sum of Distance in 2D Plane
Last Updated: 26 October 2023
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
median-finding
DSA
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
median-finding
Technical Scripter 2022
DSA
Construct two arrays satisfying the given conditions
Last Updated: 15 March 2023
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
median-finding
Technical Scripter 2022
DSA
Maximize median of Array formed by adding elements of two other Arrays
Last Updated: 19 February 2023
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
Arrays
Sorting
median-finding
DSA
Minimize increment or decrement operations to make given Array elements consecutive
Last Updated: 24 March 2023
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
Arrays
Sorting
Mathematical
median-finding
DSA
Find largest median of a sub array with length at least K
Last Updated: 27 May 2024
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
Arrays
Binary Search
Greedy
Searching
Mathematical
subarray
median-finding
DSA
C++ Program to Find median in row wise sorted matrix
Last Updated: 17 August 2023
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
Order-Statistics
Binary Search
Matrix
C++
C++ Programs
statistical-algorithms
median-finding
DSA
Java Program to Find median in row wise sorted matrix
Last Updated: 11 January 2022
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
Order-Statistics
Java
Binary Search
Matrix
Java Programs
statistical-algorithms
median-finding
DSA
Python Program to Find median in row wise sorted matrix
Last Updated: 31 July 2023
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
Order-Statistics
Binary Search
Matrix
Python
Python Programs
statistical-algorithms
median-finding
DSA
Javascript Program to Find median in row wise sorted matrix
Last Updated: 12 September 2024
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
Order-Statistics
Binary Search
Matrix
Web Technologies
JavaScript
statistical-algorithms
median-finding
DSA
Find the sum of medians of all odd length subarrays
Last Updated: 22 February 2023
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
Arrays
Sorting
Mathematical
Heap
subarray
median-finding
DSA
Maximise count of elements that are strictly greater in a subsequence than their average
Last Updated: 16 December 2021
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
Arrays
Searching
subsequence
median-finding
DSA
Maximum median possible by generating an Array of size N with sum X
Last Updated: 24 December 2021
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
median-finding
DSA
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: 24 March 2023
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
Arrays
Mathematical
Data Structures
median-finding
TrueGeek
DSA
Find Median for each Array element by excluding the index at which Median is calculated
Last Updated: 24 March 2023
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
Arrays
Sorting
Mathematical
median-finding
DSA
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 !