设有字母序列{Q,D,F,X,A,P,N,B,Y,M,C,W},请写出按二路归并方法对该序列进行一趟扫描后的结果为1。
(输出结果请按照以下格式:ABCDEFG,字母之间没有逗号)
void Merge_Sort_Array(int *arr, int start, int mid, int last, int *temp){ int index = 0; int i = start; int j = mid +1; while(i <= mid && j <= last){ if(arr[i] >= arr[j]){ temp[index++] = arr[j++]; }else{ temp[index++] = arr[i++]; } } while(i <= mid){ temp[index++] = arr[i++]; } while(j <= last){ temp[index++] = arr[j++]; } for(i = 0; i < index; i++){ arr[start + i] = temp[i]; } } void Merge_Sort(int *arr, int head, int tail, int *temp){ int mid = (head + tail) /2; if(head < tail){ //使数组的左边有序 Merge_Sort(arr, head, mid, temp); //使数组的右边有序 Merge_Sort(arr, mid + 1, tail, temp); //合并数组 Merge_Sort_Array(arr, head, mid, tail, temp); }