-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
public int getMiddle(int[] list, int low, int high) {
int temp = list[low];
while(low < high) {
while(low < high && list[high] >= temp) high--;
list[low] = list[high];
while(low < high && list[low] <= temp) low++;
list[high] = list[low];
}
list[low] = temp;
return low;
}
如上,我认为只需要将while条件中的判断条件改为>=和<=即可,我测试过,可以成功。
希望您可以采纳!!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels