Is it given that the elements contain no duplicates?


#1

I don’t think that this assumption is correct.

Some comment mentioned about using quick select with median: https://www.geeksforgeeks.org/kth-smallestlargest-element-unsorted-array-set-3-worst-case-linear-time/

… but the above solution will work only for array with non-duplicate elements. Isn’t it?