the second array may have residual elements.

This commit is contained in:
wzx
2018-04-25 19:21:45 +08:00
parent 3e647715a5
commit 172998b1ba

View File

@ -85,6 +85,12 @@ class MergeSort implements SortAlgorithm {
i++;
k++;
}
while (j <= right) {
arr[k] = temp[j];
j++;
k++;
}
}
// Driver program