quicksort implmentation (straight from cormen)