privatestaticintpartition(int[] nums, int lo, int hi){ int tmp = nums[lo];
while (lo < hi){ while (lo < hi && nums[hi] > tmp) hi--; nums[lo] = nums[hi]; while (lo < hi && nums[lo] < tmp) lo++; nums[hi] = nums[lo]; } nums[lo] = tmp; return lo; //返回中轴位置 }