1public static void BubbleSortShortSC(int[] array)
2 {
3 for(int i = 0; i < array.length - 1; i++)
4 {
5 boolean sorted = true;
6 for (int j = 0; j < array.length - i - 1; j++)
7 {
8 if(array[j] < array[j+1])
9 {
10 int temp = array[j];
11 array[j] = array[j+1];
12 array[j+1] = temp;
13 sorted = false;
14 }
15 }
16 if (sorted)
17 break;
18 }
19 }