quick sort, mid-pivot implementation