Suppose that an algorithm uses only comparisons to find the $i$-th smallest element in a set of $n$ elements. Show that it can also find the $i1$ smaller elements and the $ni$ larger elements without performing any additional comparisons.I would like to show my solution. I ask you for checking it :)Let $k$ will be $i$-th element.Let's suppose that we don't know if element $x$ is larger or smaller than $k$Then it is impossible to know if $k$ is the $i$-th element. Contradiction.It is very short proof. I can't see reason that it is not correct.
If a comparison-based algorithm finds the ith smallest element, it also classifies all the elements as a[i] or a[i]
algorithm analysis;selection problem