Implement QuickSort with callback