@@ -0,0 +1,927 @@
+package com.joyfulmath.agileexample.template.method;%0D%0A%0D%0A/**%0D%0A * @author deman.lu%0D%0A * @version on 2016-06-09 10:04%0D%0A */%0D%0Apublic class BubbleSorter %7B%0D%0A    static int operations = 0;%0D%0A    public static int sort(int%5B%5D array)%0D%0A    %7B%0D%0A        operations = 0;%0D%0A        if(array.length%3C=1)%0D%0A            return operations;%0D%0A%0D%0A        for(int nextToLast = array.length-2;nextToLast%3E=0;nextToLast--)%0D%0A            for(int index = 0;index%3C=nextToLast;index++)%0D%0A            %7B%0D%0A                compareAndSwap(array,index);%0D%0A            %7D%0D%0A        return operations;%0D%0A    %7D%0D%0A%0D%0A    private static void compareAndSwap(int%5B%5D array, int index) %7B%0D%0A        if(array%5Bindex%5D%3Earray%5Bindex+1%5D)%0D%0A        %7B%0D%0A            swap(array, index);%0D%0A        %7D%0D%0A        operations++;%0D%0A    %7D%0D%0A%0D%0A    private static void swap(int%5B%5D array, int index) %7B%0D%0A        int temp = array%5Bindex%5D;%0D%0A        array%5Bindex%5D = array%5Bindex+1%5D;%0D%0A        array%5Bindex+1%5D = temp;%0D%0A    %7D%0D%0A%7D%0D%0A

add bubble sort