quick sort improvement using median of three robert sedwick
问题 Following text from quick sort section in algorithms book by Robert Sedwick. By choosing the three elements from the left, middle, and right of the array, we can incorporate sentinels into this scheme. Sort three elements, then exchange one in the middle with a[r-1] , and then run the partitioning algorithm on a[l+1],...,a[r-2] . This improvement is called the median of three method. The median of three method helps quick sort in three ways. It makes the worst case much more unlikely to occur