public static <E extends Comparable<E>> void sort(E[] array) {
        int index = 0;
        E value = null;
        
        for(int i = 1; i < array.length; i++) {
            index = i;
            value = array[index];

            while(index > 0 && value.compareTo(array[index - 1]) < 0) {
                array[index] = array[index - 1];
                
                index--;
            }
            
            array[index] = value;
        }
    }
public static < E extends Comparable < E > > void sort ( E [ ] array ) { int index = 0 ; E value = null ; for ( int i = 1 ; i < array . length ; i ++ ) { index = i ; value = array [ index ] ; while ( index > 0 && value . compareTo ( array [ index - 1 ] ) < 0 ) { array [ index ] = array [ index - 1 ] ; index -- ; } array [ index ] = value ; } }
Sort the array in ascending order using this algorithm.

@param <E> the type of elements in this array.

@param array the array that we want to sort