Advanced partition was implemented for Quick sort