//Translation of the C++ bubble sort //Lecture notes: Prof. Barimani class SortingAPP { public static int x[]; public static void displayArr(int maxIndex) { System.out.println("\n-------------------------"); for (int i=0; i<= maxIndex; i++) System.out.println(x[i]+" "); System.out.println("\n-------------------------"); } public static void swap(int loc1, int loc2) { int temp= x[loc1]; x[loc1]= x[loc2]; x[loc2]= temp; } public static void sort(int maxIndex) { for (int i=maxIndex-1; i>=0; i--) for (int j=0; j<=i; j++) if (x[j]>x[j+1]) swap(j, j+1); } public static void main(String args[]) { System.out.println("How many numbers? "); int count; count= Integer.parseInt(Instream.getline()); x= new int[count]; System.out.println("Please enter a sequence of "+count+" numbers?"); for (int i=0; i