See More

public class bubbleSort { public static void performBubbleSort(int arr[], int n) { for(int i=0; i arr[j+1]) { int temp = arr[j]; arr[j] = arr[j+1]; arr[j+1] = temp; swaps++; } } if (swaps == 0) break; } } public static void displayArray(int arr[], int n) { for(int i=0; i