/**
* 快速排序并得出下标
*
* @param array
* @param start
* @param end
* @param indexArr
* @return
*/
private int[] quickSort(int[] array, int start, int end, int[] indexArr) {
int low = start;
int high = end;
int key = array[low];
int curIndex = indexArr[low];
while (low < high) {
while (key < array[high] && low < high) high--;
array[low] = array[high];
indexArr[low] = high;
while (key > array[low] && low < high) low++;
array[high] = array[low];
indexArr[high] = low;
}
array[high] = key;
indexArr[high] = curIndex;
if (low - 1 > start) quickSort(array, start, low - 1, indexArr);
if (high + 1 < end) quickSort(array, high + 1, end, indexArr);
return array;
}