Calculating Ith order statistic with number of comparisons