mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-07 17:56:02 +08:00
Merge pull request #429 from Hero22/master
the second array may have residual elements.
This commit is contained in:
@ -85,6 +85,12 @@ class MergeSort implements SortAlgorithm {
|
||||
i++;
|
||||
k++;
|
||||
}
|
||||
|
||||
while (j <= right) {
|
||||
arr[k] = temp[j];
|
||||
j++;
|
||||
k++;
|
||||
}
|
||||
}
|
||||
|
||||
// Driver program
|
||||
|
Reference in New Issue
Block a user