阅读背景:

使用选择排序查找数组的中位数

来源:互联网 

I'm trying to find the median from an unsorted array in Java. First, I need to use the selection sort technique to sort the array, and I cannot use any Java library methods for sorting (so no Arrays.sort(array)). Also, I cannot sort the entire array either. I can only sort as many elements as necessary to find the median of the array. I suppose for an even array, it would be just half of the elements plus one (then find the average of the last two elements), and for an odd array it would just be half of the elements (the last being the median).I'm trying to find the median from an unsorted




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: