quick sort array for any type