template<class Type, class CoType>
Definition at line 239 of file QuickSort.h. Referenced by QuickSortDescCo(). 00240 { 00241 Type val = data[left]; 00242 int lm = left-1; 00243 int rm = right+1; 00244 for(;;) 00245 { 00246 do 00247 rm--; 00248 while (data[rm] < val); 00249 00250 do 00251 lm++; 00252 while(data[lm] > val); 00253 00254 if(lm < rm) 00255 { 00256 Type temp = data[rm]; 00257 data[rm] = data[lm]; 00258 data[lm] = temp; 00259 CoType coTemp = coData[rm]; 00260 coData[rm] = coData[lm]; 00261 coData[lm] = coTemp; 00262 } 00263 else 00264 return rm; 00265 } 00266 }
|