ParentFull threadvagab0nd·Quickselect. Very elegant, fast and solves the problem. I'm surprised many people don't know about it.https://en.m.wikipedia.org/wiki/QuickselectView on HN