sorting /*quicksort algorithm (driver*template void quicksortvector quicksorta size )figure driver for quicksort the general form of the routines will be to pass the array and the range of the array (left and rightto be sorted the first routine to deal with is pivot selection the easiest way to do this is to sort [left] [right]and [centerin place this has the extra advantage that the smallest of the three winds up in [left]which is where the partitioning step would put it anyway the largest winds up in [right]which is also the correct placesince it is larger than the pivot thereforewe can place the pivot in [right and initialize and to left and right in the partition phase yet another benefit is that because [leftis smaller than the pivotit will act as sentinel for thuswe do not need to worry about running past the end since will stop on elements equal to the pivotstoring the pivot in [right- provides sentinel for the code in /*return median of leftcenterand right order these and hide the pivot *template const comparable median vector aint leftint right int center left right ifacenter aleft std::swapaleft ]acenter )ifaright aleft std::swapaleft ]aright )ifaright acenter std::swapacenter ]aright )/place pivot at position right std::swapacenter ]aright )return aright ]figure code to perform median-of-three partitioning