1
Reply

Sort the given array using the bubble sort? int[] a = { 8, 3, 11, 34, 43, 1, 67, 35, 98 };

Ritesh Singh

Ritesh Singh

Aug 13, 2016
545
0

    public int[] min(int[] a){int temp, swaps;for (int i = 0; i < a.Length; i++){swaps = 0;for (int j=0;j a[j + 1]){temp = a[j];a[j] = a[j+1];a[j + 1] = temp;swaps++;}}if (swaps == 0){break;}}return a;}

    Ritesh Singh
    August 13, 2016
    0