Skip to content

Tag: median

How to implement the medians of medians algorithm in Java

I am trying to implement the median of medians algorithm in Java. The algorithm shall determine the median of a set of numbers. I tried to implement the pseudo code on wikipedia: I am getting a buffer overflow and don’t know why. Due to the recursions it’s quite difficult to keep track of the code for me. Confirm n