Tag Archive: selection algorithm

Median of numbers (part two) / k-th smallest value

The median of numbers problem was presented in the previous posts (here and here) as being solved using a combination of two heaps. There is another solution for this problem, solution shared also by… Continue reading

Median of numbers (part one take two): max-heap + min-heap = ♥

The first solution of this problem can be found here. The problem of finding the median value in a bounded array of items can be solved, again, by using a min heap and… Continue reading

Median of numbers (part one): max-heap + min-heap = ♥

Finding the median of an unsorted array of numbers is seen as a special case of the selection algorithm. There are at least three ways in which the problem can be solved: Quickselect, based… Continue reading