Let $S$ be a set of $n$ distinct real numbers and let $k$ be a positive integer with $1<k<n$. Give a $T(n)$ time RAM algorithm to determine the middle $k$ entries of $S$. The input entries of $S$ should not be assumed ordered; however, if the elements of $S$ are such that $s_1<s_2<\ldots<s_n$, then the output of the algorithm is the (unsorted) set
$$
\left\{s_{\frac{n-k}{2}}, s_{\frac{n-k}{2}+1}, \ldots, s_{\frac{n+k}{2}-1}\right\}
$$
$T(n)$, sorting $S$ should not be part of the algorithm.