quick sort for list use avg value for pivot value