quicksort iterator implementation