Median partioning quick sort