static void quickSort(int left, int right){
if(left > right)
return;
int l = left;
int r = right;
int value = map[l];
while(l != r) {
while(l < r && map[r] >= value) {
r--;
}
while(l < r && map[l] <= value) {
l++;
}
swap(l, r);
}
swap(left, l);
quickSort(left, l - 1);
quickSort(l + 1, right);
}
[Algorithm] Java快速排序
最新推荐文章于 2024-09-29 09:19:41 发布