标签:sort div list logs end blog UI quick color
1 void quickSort(LineList R[], int first, int end) 2 { 3 int i, j; 4 LineList temp; 5 i = first; 6 j = end; 7 temp = R[i]; 8 R[0] = R[i]; 9 10 while (i < j) 11 { 12 while (i < j && R[0].key <= R[i].key) { 13 j--; 14 } 15 if (i < j) { 16 R[i] = R[j]; 17 i++; 18 } 19 20 while (i < j && R[0].key >= R[i].key) { 21 i++; 22 } 23 if (i < j) { 24 R[j] = R[i]; 25 j--; 26 } 27 28 R[i] = R[0]; 29 30 if (first < i - 1) 31 { 32 quickSort(R, first, i - 1); 33 } 34 if (i + 1 < end) { 35 quickSort(R, i + 1, end); 36 } 37 } 38 }
标签:sort div list logs end blog UI quick color
原文地址:http://www.cnblogs.com/abc-begin/p/7642652.html