@@ -0,0 +1,3158 @@
+package jp.com.argorithm;%0A%0A/**%0A * Simple sort class%0A * %3Cbr%3E%0A * TODO If you sort itself to increase in the future, and in the form to be implemented in each sorting to create the interface. %0A * %3Cbr%3E%0A * %3Ccode%3Ecf.) class BubbleSort extends AbstractSort implements Sort %3C/code%3E%0A * %3Cbr%3E%0A * Be implemented in the above form.%0A * @author pollseed%0A */%0Apublic class EasySort extends AbstractSort %7B%0A%0A    /* constructor */%0A%0A    /**%0A     * Give the specified array%0A     * @param args%0A     */%0A    public EasySort(int%5B%5D args) %7B%0A        super(args);%0A    %7D%0A%0A    /**%0A     * use the random sequences%0A     * @param maxArray Number of arrays%0A     * @param maxValue 1%EF%BD%9Eany value%0A     */%0A    public EasySort(int maxArray, int maxValue) %7B%0A        super(maxArray, maxValue);%0A    %7D%0A%0A    /* public method */%0A%0A    /**%0A     * Bubble sort%0A     */%0A    public void bubble() %7B%0A        measure(new Measure() %7B%0A            @Override%0A            public int%5B%5D sort() %7B%0A                int i = 0;%0A                while (i %3C searchArray.length - 1) %7B%0A                    for (int j = searchArray.length - 1; i %3C j; j--) %7B%0A                        if (searchArray%5Bj%5D %3C searchArray%5Bj - 1%5D) %7B%0A                            int _arg = searchArray%5Bj - 1%5D;%0A                            searchArray%5Bj - 1%5D = searchArray%5Bj%5D;%0A                            searchArray%5Bj%5D = _arg;%0A                        %7D%0A                    %7D%0A                    i++;%0A                %7D%0A                return searchArray;%0A            %7D%0A        %7D);%0A    %7D%0A%0A    /**%0A     * Selection sort%0A     */%0A    public void selection() %7B%0A        measure(new Measure() %7B%0A            @Override%0A            public int%5B%5D sort() %7B%0A                int swap%5B%5D = new int%5BsearchArray.length%5D;%0A                int i = 0;%0A                while (i %3C searchArray.length) %7B%0A                    int element = DEFAULT, suffix = DEFAULT;%0A                    int j = 0;%0A                    for (int arg : searchArray) %7B%0A                        if (arg == SENTINEL) %7B%0A                            j++;%0A                            continue;%0A                        %7D%0A                        if (element == DEFAULT) %7B%0A                            element = arg;%0A                            suffix = j;%0A                            j++;%0A                            continue;%0A                        %7D%0A                        if (arg %3C element) %7B%0A                            element = arg;%0A                            suffix = j;%0A                        %7D%0A                        j++;%0A                    %7D%0A                    swap%5Bi%5D = element;%0A                    searchArray%5Bsuffix%5D = SENTINEL;%0A                    i++;%0A                %7D%0A                return swap;%0A            %7D%0A        %7D);%0A    %7D%0A%0A    /**%0A     * return the sorted array%0A     * @return%0A     */%0A    public int%5B%5D getSorted() %7B%0A        return super.sorted;%0A    %7D%0A%0A    /* private method */%0A%0A    private final void measure(Measure m) %7B%0A        final long startTime = System.nanoTime();%0A        super.sorted = m.sort();%0A        final long estimatedTime = System.nanoTime() - startTime;%0A        System.out.println(estimatedTime + %22ms%22);%0A    %7D%0A%0A    private interface Measure %7B%0A        int%5B%5D sort();%0A    %7D%0A%7D%0A

Create EasySort.java