Use heap selection algorithm for intermediate sized data sets.

We can use an O(nlogk) solution when the data set has relatively small n
and k.
Tweaking parameters for best performance.