摘要:
1 //插入排序 2 void InsertionSort(ElementType A[], int N) 3 { 4 int p, i, tmp; 5 for(p = 1; p = 1) 10 { 11 if(A[i-1] > tmp) 12 A[i] = A[i-1]; //... 阅读全文
摘要:
1 void Swap(ElementType *a, ElementType *b) 2 { 3 ElementType tmp = *a; 4 *a = *b; 5 *b = tmp; 6 } 7 8 //选择排序 9 void SelectionSort(ElementType A[], int N) 10 { 11 for(in... 阅读全文
摘要:
1 void Swap(ElementType *a, ElementType *b) 2 { 3 ElementType tmp = *a; 4 *a = *b; 5 *b = tmp; 6 } 7 8 //冒泡排序 9 void BubbleSort(ElementType A[], int N) 10 { 11 for(in... 阅读全文