Skip to main content

Questions tagged [median]

For code which finds the statistical median of a set of values.

5 votes
1 answer
241 views

I am computing the rolling Median Absolute Deviation (MAD) in R for outlier detection in a time series dataset. The goal is to: Detect outliers based on a rolling MAD. Exclude previously detected ...
user2845095's user avatar
2 votes
2 answers
437 views

Problem Statement (Source: Leetcode Problem 4: Median of Two Sorted Arrays [Hard])(Topics: [Array] [Binary Search] [Divide and Conquer]) Given two sorted arrays ...
CrSb0001's user avatar
  • 619
5 votes
1 answer
104 views

Another look at finding median value. This time the input is a histogram represented as an ordered range of (value, count) pairs, or simply as a range of counts, with value inferred from position. I'...
Toby Speight's user avatar
  • 88.5k
7 votes
2 answers
1k views

Going through the Rust book for the second time as I've been wrapped up in Typescript for a while and I want to build a personal project in Rust. In chapter 8.3, there's an exercise: Given a list of ...
Lewis Farnworth's user avatar
6 votes
2 answers
95 views

I recently posted an externally-evaluating median algorithm (i.e. not requiring move or copy of elements), and the feedback encouraged me to develop it further. One simple suggestion was to handle NaN ...
Toby Speight's user avatar
  • 88.5k
7 votes
2 answers
1k views

I have implemented a simple version of the median cut algorithm. It takes a vector of Color structs representing pixel in an image. I also use the ...
チーズパン's user avatar
4 votes
1 answer
510 views

For practice, I've been playing with calculating median values. This time, I wanted to make something that works well without copying the input values (perhaps because they are bulky, or of a type ...
Toby Speight's user avatar
  • 88.5k
3 votes
2 answers
266 views

Follow on from this codereview: generic implementation of median As before the vector2 class is just for illustrative purposes and not the focus. I have ...
Oliver Schönrock's user avatar
6 votes
3 answers
793 views

Below is a generic implementation of the summary statistics function Median. Discussion of efficient use of std::nth_element and ...
Oliver Schönrock's user avatar
1 vote
1 answer
93 views

I was solving a DSA question, running median in a stream. And I decided to design my own stream class with additional features. ...
Ankush Tripathi's user avatar
3 votes
1 answer
983 views

https://leetcode.com/problems/sliding-window-median/ Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean ...
Gilad's user avatar
  • 5,443
5 votes
2 answers
194 views

Given an array of numbers arr and a window of size k, print out the median of each window of size k starting from the left and moving right by one position each time. For example, given the ...
Furch Radeon's user avatar
4 votes
2 answers
361 views

I'm trying to solve a programming challenge where I have to find the median of given subarrays of an array. I have used std::vector's ...
PasanW's user avatar
  • 185
3 votes
1 answer
489 views

The task is taken from leetcode There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should ...
thadeuszlay's user avatar
  • 4,015
6 votes
2 answers
2k views

I am implementing a method to find the median of an unsorted array using a counting sort. I would happily go for a median of medians or selection algorithm for better performance but they are ...
CocoCrisp's user avatar
  • 439

15 30 50 per page