标签:int select [] key list i++ 选择排序 oid col
1 void selectSort(LineList R[], int n) 2 { 3 int i, j, index; 4 for (i = 1; i < n; i++) 5 { 6 index = i; 7 for (j = i + 1; j <= n; j++) 8 { 9 if (R[j].key < R[index].key) 10 { 11 index = j; 12 } 13 } 14 15 if (index != i) 16 { 17 R[0].key = R[i].key; 18 R[i].key = R[index].key; 19 R[index].key = R[0].key; 20 } 21 } 22 }
标签:int select [] key list i++ 选择排序 oid col
原文地址:http://www.cnblogs.com/abc-begin/p/7644337.html