@@ -0,0 +1,828 @@
+/*%0A * Bubble sort is a simple sorting algorithm that repeatedly steps through the list to be sorted, %0A * compares each pair of adjacent items and swaps them if they are in the wrong order. %0A * The pass through the list is repeated until no swaps are needed, which indicates that the list is sorted.%0A * Author : Viveka Aggarwal%0A */%0A%0Apublic class bubbleSort %7B%0A%09public static void sort(int%5B%5D arr) %7B%0A%09%09int n = arr.length-2;%0A%09%09while(n %3E 0) %7B%0A%09%09%09for(int j = 0 ; j %3C= n ; j++) %7B%0A%09%09%09%09if(arr%5Bj%5D %3E= arr%5Bj+1%5D)%0A%09%09%09%09%09swap(j, j+1, arr);%0A%09%09%09%7D%0A%09%09%09n--;%0A%09%09%7D%0A%09%7D%0A%09%0A%09public static void swap(int a, int b, int%5B%5D arr) %7B%0A%09%09int temp = arr%5Ba%5D; %0A%09%09arr%5Ba%5D = arr%5Bb%5D; %0A%09%09arr%5Bb%5D = temp;%0A%09%7D%0A%09%0A%09public static void main(String%5B%5D a) %7B%0A%09%09int%5B%5D arr = %7B23, 3, 12, 54, 34, 77, 78, 87, 92, 12%7D;%0A%09%09sort(arr);%0A%09%09for(int i : arr) %7B%0A%09%09%09System.out.print(i + %22 %22);%0A%09%09%7D%0A%09%7D%0A%7D%0A

Create bubbleSort.java