A variant of quicksort which switches to heapsort for pathological inputs, that is, when execution time is becoming quadratic.