My Favorite Algorithm: Linear Time Median Finding (2018)

In this post, the author discusses the challenge of finding the median of a list in linear time, focusing on the median-of-medians approach. The post explains the quickselect algorithm and introduces the deterministic pivot selection algorithm developed by Blum, Floyd, Pratt, Rivest, and Tarjan in 1973. The author provides detailed Python implementations, proofs of average and deterministic linear time complexity, and comparisons with other selection algorithms. The post also mentions the introselect algorithm used in the C++ standard library. Overall, the author offers a thorough exploration of finding the median in different scenarios, showcasing the math behind the algorithms.

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

To top