@@ -0,0 +1,1026 @@
+public class TwoWaySort %7B%0A%0A    static void eosort(int%5B%5D t) %7B%0A%0A        printInts(t);%0A%0A        int i, ei, oi, l = t.length;%0A%0A        for (i=ei=0; i %3C l; i++)%0A            if (t%5Bi%5D %25 2 == 0) ei++;%0A%0A        int%5B%5D r = new int%5Bl%5D,%0A              e = new int%5Bei%5D,%0A              o = new int%5Bl-ei%5D;%0A%0A        for (i=ei=oi=0; i %3C l; i++) %7B%0A            if (t%5Bi%5D %25 2 == 0) e%5Bei++%5D = t%5Bi%5D;%0A            else o%5Boi++%5D = t%5Bi%5D;%0A        %7D%0A%0A        java.util.Arrays.sort(e);%0A        java.util.Arrays.sort(o);%0A        for(i = 0, oi=o.length; i %3C oi/2; i++) %7B%0A            int s = o%5Bi%5D;%0A            o%5Bi%5D = o%5Boi-i-1%5D;%0A            o%5Boi-i-1%5D = s;%0A        %7D%0A%0A        for (i=ei=oi=0; i %3C l; i++)%0A            r%5Bi%5D = t%5Bi%5D %25 2 == 0 ? e%5Bei++%5D : o%5Boi++%5D;%0A%0A        printInts(r);%0A%0A    %7D%0A%0A    static void printInts(int%5B%5D t) %7B%0A        for (int i = 0; i %3C t.length; i++)%0A            System.out.print(t%5Bi%5D + %22 %22);%0A        System.out.println();%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A%0A        int%5B%5D t = %7B0,1,2,3,4,5,6,7,8,9%7D;%0A%0A        eosort(t);%0A%0A    %7D%0A%0A%7D%0A

Add TwoWaySort