News for hackers. Stuff that matters.
Re:A software engineering interview question I like: computi... by dimview on Wednesday July 08, 2026 @10:13PM (#48840115)
You can do it a bit faster by not quicksorting the entire array, as you don't really care about the order of the lowest and highest numbers as long as they are not close to the middle.

There is also an approximate algorithm that does not keep all the data in memory at the same time.

Re:A software engineering interview question I like: computi... by raddan on Wednesday July 08, 2026 @10:25PM (#48840221)
The rabbit hole goes deep fast with this one!

https://rcoh.me/posts/linear-time-median-finding/

I vaguely recall learning a randomized (approximate) streaming median algorithm in grad school, but the details have left my brain…