9.6.    ____________________255

 front  back       
 .

template<class T>

* partifcion(T* from, T* to)

{

* front = from;

* back = to - 1;

 compare;

compare = *from;     // 
++front;             //   
while (front < back) {

//  "  " ()
while ((front < back) &&(compare > *front))
++front;

//  "  " ()
while ((front < back) &&(compare <= *back))
--back;

swap(*front, *back) ;

}

//    

if (compare >= * front) {

swap(*from, * front);

return (front);

}
else {

swap(* from, *(front - 1));

return (front - 1) ;

}
}

      .   -
     , :

vector<int> v(n); //    
     

quicksort(v.begin(), v.end());

,        -
,    .

9.6.    

       -
 void*,     .   -
      
.