private void quickSort0(int[] a, int low, int high) { //the valid elements of the list are [low, high]
        if (high - low <= 1)
            return;

        if (high - low == 2) { //efficient!
            if (a[low] > a[low + 1])
                swap(low, low + 1);

            return;
        }

//        if (high - low < 20) {
//            for (int i = low; i < high - 1; i++) {
//                focus(i, Color.BLUE);
//                int lowest = i;
//                for (int j = i + 1; j < high; j++) {
//                    //focus(j, Color.yellow);
//                    if (a[lowest] > a[j])
//                        lowest = j;
//                    //focus(j, null);
//                }
//                swap(i, lowest);
//                focus(i, null);
//            }
//        }

        int n = high - low; //number of elements in the list.
        int p = pivot(a, low, high); //median of three; pivot's index.
        int pivot = a[p]; //p's value, the pivot value
        int i = low;
        int j = high - 2;
        swap(p, high - 1); //store the pivot at the end.

        while (i <= j) {
            while (a[i] < pivot && i < high - 2) { //don't run into the pivot we stored at index [high-1]
                i++;
            }

            while (a[j] > pivot && j > low) {
                j--;
            }

            if (i <= j) {
                swap(i, j);
                i++;
                j--;
            }
        }

        swap(i, high - 1); //put the pivot into its correct spot.
        addRun(low, i);
        addRun(i + 1, high);
    }