#include #include #include void Oddeven_sort(int length, int B[]); /*********************************************************************/ main() { int list_length; int i; int N=15, n=1; /* 计 2^N */ int start_index; int *A; float ttime; clock_t start_time, end_time; for (i = 0; i < N; i++) n = (long)n * 2; A = malloc(n * sizeof(int)); srand(time(NULL)); for (i=0; i 4) { Oddeven_sort(half_way, B); Oddeven_sort(half_way, B + half_way); } /* рㄢ计计案计场だ耚娩 */ for (i = 0; i < half_way; i=i+2) if (B[i] < B[half_way + i]) { temp[i]=B[i]; temp[i+1]=B[half_way + i]; } else { temp[i]=B[half_way + i]; temp[i+1]=B[i]; } for (i = 1; i < half_way; i=i+2) if (B[i] < B[half_way + i]) { temp[half_way + i-1]=B[i]; temp[half_way + i]=B[half_way + i]; } else { temp[half_way + i-1]=B[half_way + i]; temp[half_way + i]=B[i]; } /* 计蛤案计竒だㄓ碞琌 sort */ for (i=0; i 4) { Oddeven_sort(half_way, B); Oddeven_sort(half_way, B + half_way); } for (i=0; i