We use a robust measure of presortedness, based on the notion of $α$-sorted sub-sequences, to show that Quicksort, in general, Partition sort, is optimal for a much broader class of inputs than those captured by worst-case analysis. Our result also generalizes the well-known result on sorting multisets with repeated elements (called multisorting) to a more general class of permutations that is based on entropy measure. We revisit some existing sorting algorithms from this perspective, and show that unlike previous entropy based measures, we can prove a nearly matching information theoretic lower bound. This perspective can open up interesting directions for adaptive design and analysis of fundamental algorithmic problems beyond traditional worst-case or average-case paradigms.
翻译:暂无翻译