Skip to content

Commit be7d4ff

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

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

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

-13
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.thealgorithms.sorts;
22

33
public class AdaptiveMergeSort implements SortAlgorithm {
4-
54
@SuppressWarnings("unchecked")
65
public <T extends Comparable<T>> T[] sort(T[] array) {
76
if (array.length <= 1) {
@@ -24,7 +23,6 @@ private <T extends Comparable<T>> void sort(T[] array, T[] aux, int low, int hig
2423

2524
private <T extends Comparable<T>> void merge(T[] array, T[] aux, int low, int mid, int high) {
2625
System.arraycopy(array, low, aux, low, high - low + 1);
27-
2826
int i = low;
2927
int j = mid + 1;
3028
for (int k = low; k <= high; k++) {
@@ -39,15 +37,4 @@ private <T extends Comparable<T>> void merge(T[] array, T[] aux, int low, int mi
3937
}
4038
}
4139
}
42-
43-
public static void main(String[] args) {
44-
AdaptiveMergeSort adaptiveMergeSort = new AdaptiveMergeSort();
45-
// Integer Input
46-
Integer[] integers = {4, 23, 6, 78, 1, 54, 231, 9, 12};
47-
SortUtils.print(adaptiveMergeSort.sort(integers));
48-
49-
// String Input
50-
String[] strings = {"c", "a", "e", "b", "d"};
51-
SortUtils.print(adaptiveMergeSort.sort(strings));
52-
}
5340
}

0 commit comments

Comments
 (0)