Two solutions for QuickSort