@@ -0,0 +1,1342 @@
+package me.alivecode.algs4;%0A%0Aimport edu.princeton.cs.algs4.StdIn;%0A%0Apublic class Quick3way %7B%0A    %0A    private Quick3way() %7B%7D%0A%0A    private static void sort(Comparable%5B%5D a, int lo, int hi) %7B%0A        if (hi %3C= lo) return;%0A        int i = lo + 1; %0A        int lt = lo, gt = hi;%0A        Comparable v = a%5Blo%5D;%0A%0A        while(i %3C= gt) %7B%0A            int cmp = a%5Bi%5D.compareTo(v);%0A            // lt always points to the left most item valued 'v'. %0A            // Move smaller items to the left side of 'v'.%0A            // This operation inserted an item to the left of lt and i, %0A            // increase lt and i to give one slot to that item.%0A            if (cmp %3C 0) %7B SortUtil.exch(a, lt++, i++); %7D %0A            // Move larger items to the right side of 'v' %0A            else if (cmp %3E 0) %7B SortUtil.exch(a, i, gt--); %7D%0A            // current item equal to 'v', move to the next item. %0A            else %7B i++; %7D%0A        %7D%0A%0A        sort(a, lo, lt-1);%0A        sort(a, gt+1, hi);%0A%0A        assert SortUtil.isSorted(a, lo, hi);%0A    %7D %0A%0A    public static void sort(Comparable%5B%5D a) %7B%0A        StdRandom.shuffle(a);%0A        sort(a, 0, a.length-1);%0A        assert SortUtil.isSorted(a);%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        String%5B%5D a = StdIn.readAllStrings();%0A        SortUtil.show(a);%0A        sort(a);%0A        SortUtil.show(a);%0A    %7D%0A%7D%0A

Add quick 3 way sort.