行者

慢慢走,不要停
  博客园  :: 新随笔  :: 管理

2020年5月31日

摘要: #include<stdio.h> void Merge(int arr[],int L,int M,int R) { int LeftSize=M-L; int RightSize=R-M+1; int Left[LeftSize]; int Right[RightSize]; /*1.fill 阅读全文

posted @ 2020-05-31 23:20 angury 阅读(137) 评论(0) 推荐(0)

摘要: void selectSort(int A[],int N) { int i,j; for(i=0;i<N-1;i++) { for(j=i+1;j<N;j++) { if(A[i]>A[j]) { int tmp=A[j]; A[j]=A[i]; A[i]=tmp; } } } } 阅读全文

posted @ 2020-05-31 23:16 angury 阅读(134) 评论(0) 推荐(0)

摘要: void bubbleSort(int A[],int N) { int i,j; for(i=0;i<N;i++) { for(j=0;j<N-i-1;j++) { if(A[j]>A[j+1]) { int tmp=A[j+1]; A[j+1]=A[j]; A[j]=tmp; } } } } 阅读全文

posted @ 2020-05-31 23:15 angury 阅读(157) 评论(0) 推荐(0)

摘要: void shellSort(int A[],int N) { int i,j,k; for(k=N/2;k>0;k/=2) { for(i=k;i<N;i=i+k) { int tmp=A[i]; for(j=i-k;j>=0&&tmp<A[j];j=j-k)/*注意:j>=0,j=j-k*/ { 阅读全文

posted @ 2020-05-31 23:14 angury 阅读(87) 评论(0) 推荐(0)