Data Structures, Algorithms, Java, Big O Notation, Searching And Sorting.
Initial indexes of first and second subarrays int i = 0, j = 0; // Initial index of merged subarray array int mergedArrIndex = left; while (i < size1 && j < size2) { if (Left[i] <= Right[j]) { arr[mergedArrIndex] = Left[i]; i++; } else { arr[mergedArrIndex] = Right[j]; j++; } k++; } /* Copy