(int[] arr)
| 1 | public class MySorting { |
| 2 | |
| 3 | public static void bubbleSort(int[] arr) { |
| 4 | boolean swapped = true; |
| 5 | int n = arr.length; |
| 6 | while (swapped) { |
| 7 | swapped = false; |
| 8 | for (int i = 1; i < n; i++) { |
| 9 | if (arr[i - 1] > arr[i]) { |
| 10 | int temp = arr[i - 1]; |
| 11 | arr[i - 1] = arr[i]; |
| 12 | arr[i] = temp; |
| 13 | swapped = true; |
| 14 | } |
| 15 | } |
| 16 | n--; |
| 17 | } |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | public class MySorting { |
nothing calls this directly
no outgoing calls
no test coverage detected