摘要:
/*crate a new array to put the elements sorted*/void MergeSort(int a[], int n){ int *TmpArray; TmpArray = (int*)malloc(n*sizeof(int)); if (TmpArray != 阅读全文
posted @ 2016-12-17 22:48
z_Vincent
阅读(170)
评论(0)
推荐(0)
摘要:
void Insertsort(int a[], int n){ int i, j; int Tmp; for (i = 1; i < n; i++)//from the second element for (j = i - 1; j >= 0 && a[j] > a[j + 1]; j--){ 阅读全文
posted @ 2016-12-17 22:26
z_Vincent
阅读(109)
评论(0)
推荐(0)
摘要:
代码: void HeapSort(int a[], int n){ int Tmp; for (int i = n / 2; i >= 0; i--) PercDown(a, i, n); /*build a heap; we should know that intinially we put 阅读全文
posted @ 2016-12-17 22:18
z_Vincent
阅读(133)
评论(0)
推荐(0)

浙公网安备 33010602011771号