Quickselect and partial sort.