Skip to content

Commit 7cf4bdb

Browse files
authored
Update AdaptiveMergeSort.java
1 parent eacb7f2 commit 7cf4bdb

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/main/java/com/thealgorithms/sorts/AdaptiveMergeSort.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ private <T extends Comparable<T>> void sort(T[] array, T[] aux, int low, int hig
2323
}
2424

2525
private <T extends Comparable<T>> void merge(T[] array, T[] aux, int low, int mid, int high) {
26-
for (int k = low; k <= high; k++) {
27-
aux[k] = array[k];
28-
}
26+
System.arraycopy(array, low, aux, low, high - low + 1);
2927

3028
int i = low;
3129
int j = mid + 1;

0 commit comments

Comments
 (0)