quicksort implementation according to Tim Roughgarden pseudocode