(int arr[])
| 17 | } |
| 18 | |
| 19 | public static void modifiedBubbleSort(int arr[]) { |
| 20 | for(int turn=0; turn<arr.length-1; turn++) { |
| 21 | boolean swapped = false; |
| 22 | for(int j=0; j<arr.length-1-turn; j++) { |
| 23 | if(arr[j] > arr[j+1]) { |
| 24 | //swap |
| 25 | int temp = arr[j]; |
| 26 | arr[j] = arr[j+1]; |
| 27 | arr[j+1] = temp; |
| 28 | swapped = true; |
| 29 | } |
| 30 | } |
| 31 | if(swapped == false) { |
| 32 | break; |
| 33 | } |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | public static void bubbleSortDescending(int arr[]) { |
| 38 | for(int turn=0; turn<arr.length-1; turn++) { |
nothing calls this directly
no outgoing calls
no test coverage detected