quick sort in 3 partition.