[Solved] Type of sorting algorithm


After eliminating useless code, renaming variables and formatting it:

private static void Sort(int[] array) {
   for (int j = 1; j < array.length; j++) {
        int value = array[j];
        int index = j-1;
        while ( (index >= 0) && (array[index] < value) ) {
            array[index + 1] = array[index];
            index--;
        }
        array[index + 1] = value; 
    }
}

Now it is easy to see, that in the inner while-loop big values rise up in the array (like bubbles in the water), hence it’s indeed an implementation of the Bubble Sort Algorithm

solved Type of sorting algorithm