Added Singletons & Empty variants of Collections
This commit is contained in:
1 parent
0b11c3929a
commit
06752fe30c
10 files changed
+804
-11
No files matched your search
@@ -345,11 +345,11 @@ public class ARRAYS
|
||||
public static GENERIC_KEY_BRACES void insertionSort(KEY_TYPE[] array, int from, int to, COMPARATOR KEY_GENERIC_TYPE comp) {
|
||||
for (int i = from+1;i<to; i++) {
|
||||
KEY_TYPE current = array[i];
|
||||
int j = i - 1;
|
||||
while(j >= from && comp.compare(current, array[j]) < 0) {
|
||||
array[j+1] = array[j--];
|
||||
}
|
||||
array[j+1] = current;
|
||||
int j = i - 1;
|
||||
while(j >= from && comp.compare(current, array[j]) < 0) {
|
||||
array[j+1] = array[j--];
|
||||
}
|
||||
array[j+1] = current;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user