#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<vector>
#include<queue>
#include<stack>
#include<limits>
#include<algorithm>
#include<math.h>
#pragma warning(disable:4996)
using namespace std;
//Merge(归并):把两个或多个有序的子序列合并为一个,2路归并——二合一
//1.若low>high,则将序列从中间mid=(low+high)/2分开
//2.对左半部分[low,mid]递归地进行归并排序
//3.对右半部分[mid+1,high]递归地进行归并排序
//4.将左右两个有序子序列Merge为一个
//归并排序
const int N = 1000;
int* B = (int*)malloc(N * sizeof(int));<
归并排序(C++实现)
最新推荐文章于 2025-03-24 20:06:28 发布