(int[] arr, int n)
| 3 | public class code { |
| 4 | |
| 5 | public static int[] bSort(int[] arr, int n) { |
| 6 | for (int i = 0; i < n; i++) { |
| 7 | for (int j = 0; j < n - 1 - i; j++) { |
| 8 | if (arr[j] > arr[j + 1]) { |
| 9 | int temp = arr[j]; |
| 10 | arr[j] = arr[j + 1]; |
| 11 | arr[j + 1] = temp; |
| 12 | } |
| 13 | } |
| 14 | } |
| 15 | return arr; |
| 16 | } |
| 17 | |
| 18 | public static void main(String[] args) throws java.lang.Exception { |
| 19 | Scanner sc = new Scanner(System.in); |