Java Utililty Methods Array Sort

List of utility methods to do Array Sort

Description

The list of methods to do Array Sort are organized into topic(s).

Method

int[]union(int[] sorted1, int[] sorted2)
union
int[] result = new int[sorted1.length + sorted2.length];
int i = 0, j = 0, k = 0;
while (i < sorted1.length && j < sorted2.length) {
    if (sorted1[i] < sorted2[j]) {
        result[k] = sorted1[i];
        i++;
    } else if (sorted1[i] > sorted2[j]) {
        result[k] = sorted2[j];
...
String[]uniqueExclusiveSort(String[] values, String[] removeValues)
Remove from values all removeValues and build a unique sorted result array.
Set<String> unique = new HashSet<String>();
unique.addAll(Arrays.asList(values));
for (String removeValue : removeValues) {
    unique.remove(removeValue);
String[] uniqueArr = unique.toArray(new String[unique.size()]);
Arrays.sort(uniqueArr);
return uniqueArr;
...