leetcode:75颜色分类(3way).215数组中的第K个最大元素(normal) 3way private static void quick3waySort(int[] arr, int left, int hi) { if (lo >= hi) return; // 注意大于等于 int mid = left + (right - left) / 2; swap(arr, lo, mid); int val = arr[lo]; // lt表示等于val的,lt-1才是小于val的位…
Given an array with n objects colored red, white or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white and blue. Here, we will use the integers 0, 1, and 2 to represent the color red, whit…