From caa8265b06e77746e92e62401532cf6620946202 Mon Sep 17 00:00:00 2001 From: wzx Date: Wed, 25 Apr 2018 19:21:45 +0800 Subject: [PATCH] modify MergeSort.java --- Sorts/src/sort/MergeSort.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sorts/src/sort/MergeSort.java b/Sorts/src/sort/MergeSort.java index 4f294dc7..2c7a141b 100644 --- a/Sorts/src/sort/MergeSort.java +++ b/Sorts/src/sort/MergeSort.java @@ -85,6 +85,12 @@ class MergeSort implements SortAlgorithm { i++; k++; } + + while (j <= right) { + arr[k] = temp[j]; + j++; + k++; + } } // Driver program