(int [] arr)
| 53 | } |
| 54 | |
| 55 | public static void bubbleSort(int [] arr) { |
| 56 | int n = arr.length; |
| 57 | for (int i = 0; i < n - 1- i; i++) { |
| 58 | for (int j = 0; j < n - 1; j++) { |
| 59 | if ( arr[j] > arr[j + 1]) { |
| 60 | int temp = arr[j]; |
| 61 | arr[j] = arr[j + 1]; |
| 62 | arr[j + 1] = temp; |
| 63 | } |
| 64 | } |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | public static int[] takeInput() { |
| 69 | Scanner sc = new Scanner(System.in); |