How can i alter this code in order to run it in Linear time? I am aware that Collection.sort runs at n*log(n) time, so I browsed through some articles that tried to use the "median of medians" or solving by using Quick selection. However, I am not that familiar with generic type < T > and I have been stuck with this task for days now. Can someone help me?