Select the k-th smallest item from an unordered array in O(n) in python