implement quick sort with Hoare partitioning