added quick sort with 3-way partitioning