Skip to content

Commit 65ddffc

Browse files
committed
Clang formatting for swap function
1 parent 9bd6749 commit 65ddffc

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/main/java/com/thealgorithms/randomized/RandomizedQuickSort.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ private static int partition(int[] arr, int low, int high) {
5050
}
5151

5252
/**
53-
* Swaps two elements in the array, only if the indices are different.
54-
*
55-
* @param arr the array in which elements are to be swapped
56-
* @param i the first index
57-
* @param j the second index
58-
*/
53+
* Swaps two elements in the array, only if the indices are different.
54+
*
55+
* @param arr the array in which elements are to be swapped
56+
* @param i the first index
57+
* @param j the second index
58+
*/
5959
private static void swap(int[] arr, int i, int j) {
60-
if (i == j) return;
60+
if (i == j) return; // Skip if indices are the same
6161
int temp = arr[i];
6262
arr[i] = arr[j];
6363
arr[j] = temp;

0 commit comments

Comments
 (0)