From 1280fc08a25e2d891b6111d3dd5055d080d96b2c Mon Sep 17 00:00:00 2001 From: pqz4hix59 <1551744337@qq.com> Date: Thu, 17 Feb 2022 19:05:49 +0800 Subject: [PATCH] ADD file via upload --- 归并排序.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 归并排序.cpp diff --git a/归并排序.cpp b/归并排序.cpp new file mode 100644 index 0000000..5fe3dbc --- /dev/null +++ b/归并排序.cpp @@ -0,0 +1,28 @@ +#include +int n,num[100010],tmp[100010]; +void sort(int l,int r) +{ + if(l>=r) + return; + int mid=(l+r)/2; + sort(l,mid); + sort(mid+1,r); + int k=0,i=l,j=mid+1; + while(i<=mid&&j<=r) + if(num[i]