figure does the median-of-three partitioning with all the side effects described it may seem that it is only slightly inefficient to compute the pivot by method that does not actually sort [left] [center]and [right]butsurprisinglythis produces bad results (see exercise the real heart of the quicksort routine is in figure it includes the partitioning and recursive calls there are several things worth noting in this implementation line initializes and to past their correct valuesso that there are no special cases to consider this initialization depends on the fact that median-of-three partitioning has /*internal quicksort method that makes recursive calls uses median-of-three partitioning and cutoff of is an array of comparable items left is the left-most index of the subarray right is the right-most index of the subarray *template void quicksortvector aint leftint right ifleft <right const comparable pivot median aleftright )/begin partitioning int leftj right forwhilea++ pivot whilepivot -- ifi std::swapai ]aj )else breakstd::swapai ]aright )quicksortalefti )quicksortai right )else /restore pivot /sort small elements /sort large elements /do an insertion sort on the subarray insertionsortaleftright )figure main quicksort routine