template<class Type>
Definition at line 39 of file QuickSort.h. Referenced by QuickSort(). 00040 { 00041 Type val = data[left]; 00042 int lm = left-1; 00043 int rm = right+1; 00044 for(;;) 00045 { 00046 do 00047 rm--; 00048 while (data[rm] > val); 00049 00050 do 00051 lm++; 00052 while(data[lm] < val); 00053 00054 if(lm < rm) 00055 { 00056 Type tempr = data[rm]; 00057 data[rm] = data[lm]; 00058 data[lm] = tempr; 00059 } 00060 else 00061 return rm; 00062 } 00063 }
|