@@ -1 +1,1478 @@
+package com.sort.quicksortthreeways;%0A%0Apublic class QuickSortThreeWays %7B%0A    private QuickSortThreeWays() %7B%7D%0A    %0A    private static void swap(int%5B%5D arr, int i, int j) %7B%0A        int temp = arr%5Bi%5D;%0A      %0A        arr%5Bi%5D = arr%5Bj%5D;%0A      %0A        arr%5Bj%5D = temp;%0A    %7D%0A  %0A    public static void sort(int%5B%5D arr, int low, int high) %7B%0A        if (low %3C high) %7B%0A            %0A           // partition %E6%93%8D%E4%BD%9C%0A            int e = arr%5Blow%5D;%0A            %0A            int left = low;        // arr%5Blow+1...left%5D %3C e%0A            int right = high + 1;  // arr%5Bright...high%5D %3E e%0A            int i = low + 1;       // arr%5Bleft+1...i) == e%0A          %0A            while (i %3C right) %7B%0A                if (arr%5Bi%5D %3C e) %7B%0A                    swap(arr, i, left + 1);%0A                    i++;%0A                    left++;%0A                %7D else if (arr%5Bi%5D %3E e) %7B%0A                    swap(arr, i, right - 1);%0A                    right--;%0A                %7D else %7B%0A                    i++;%0A                %7D%0A            %7D%0A          %0A            swap(arr, low, left);%0A            %0A            // arr%5Blow...left-1%5D %3C e %E6%8E%92%E5%BA%8F%0A            sort(arr, low, left - 1);%0A            %0A            // arr%5Bright...high%5D %3E e %E6%8E%92%E5%BA%8F%0A            sort(arr, right, high);%0A        %7D%0A    %7D%0A    %0A    public static void main(String%5B%5D args) %7B%0A        int%5B%5D arr = %7B2, 5, 8, 7, 6, 4, 13, 7, 1, 11%7D;%0A        %0A        sort(arr, 0, arr.length - 1);%0A        %0A        for (int item : arr) %7B%0A            System.out.print(item + %22 %22);%0A        %7D%0A    %7D%0A%7D
 %0A

Update QuickSortThreeWays.java