摘要:#include<stdio.h> #include<stdlib.h> void radix_sort(int A[],int N) { int max=A[0]; int i; for(i=0;i<N;i++) { max=(max>A[i])?max:A[i]; } int *t=(int *
阅读全文
posted @ 2020-06-03 17:01
|
|||
06 2020 档案
摘要:#include<stdio.h> #include<stdlib.h> void radix_sort(int A[],int N) { int max=A[0]; int i; for(i=0;i<N;i++) { max=(max>A[i])?max:A[i]; } int *t=(int *
阅读全文
posted @ 2020-06-03 17:01
摘要:#include<stdio.h> #include<stdlib.h>void count_sort(int A[],int B[],int N) { /* **A:原数组 **B:排序后数组 **N:AB数组的长度 */ /* **计算原数组中数据的范围,确定count的长度 */ int ma
阅读全文
posted @ 2020-06-02 20:07
摘要:#include<stdio.h> void swap(int A[],int i,int j) { int tmp=A[i]; A[i]=A[j]; A[j]=tmp; } void heapify(int A[],int N,int i) {/*可有可无 if(i>=N) { return; }
阅读全文
posted @ 2020-06-01 18:35
摘要:int get_mid(int A[],int left,int right) { int pivot=A[left]; while(left<right) { for(;A[right]>=pivot&&left<right;right--)/*> 错,>= 对*/ { ; } A[left]=A
阅读全文
posted @ 2020-06-01 10:33
|
|||