码牛移动高级开发VIP正式课二三四期
private void mergeTwoSortedArray(int[] nums, int[] temp, int start, int mid, int end) {
// merge two sorted array
int index = start;
int first = start;
int second = mid + 1;
while (first <= mid && second <= end) {
if (nums[first] < nums[second]) {
temp[index++] = nums[first++];
} else {
temp[index++] = nums[second++];
}
}