Swaps two elements in an array. @param arr the input array @param i the index of the first element @param j the index of the second element
(int[] arr, int i, int j)
| 171 | * @param j the index of the second element |
| 172 | */ |
| 173 | public static void swap(int[] arr, int i, int j) { |
| 174 | int temp = arr[i]; |
| 175 | arr[i] = arr[j]; |
| 176 | arr[j] = temp; |
| 177 | } |
| 178 | } |
no outgoing calls
no test coverage detected