Different Ways of Sorting Arrays in Java Selection Sort Algorithm
Different Ways of Sorting Arrays in Java Selection Sort Algorithm
mergeSort(array, 0, n-1);
printArray(array);
}
while((l <= m) && (r <= j)) // fill out the aux array
{
if (a[l] < a[r]) // take the minimum of a[l] and a[r]
{
aux[k] = a[l]; // ... and put it into aux
l++; // update the left pointer
k++; // update the aux pointer
}
else
{
aux[k] = a[r];
r++; // update the right pointer
k++; // update the aux pointer
}
}