A new solution for the Dutch national flag problem is proposed, requiring no three-way comparisons, which gives quicksort a proper worst-case runtime of $O(nk)$ for inputs with $k$ distinct elements. This is used together with other known and novel techniques to construct a hybrid sort that is never significantly slower than regular quicksort while speeding up drastically for many input distributions.
翻译:荷兰提出了解决荷兰国旗问题的新办法,不需要三路比较,这样可以让快速流星最坏的运行时间为$O(nk)美元,用于具有美元不同要素的投入。 这与其他已知和新颖技术一起用来构建一种混合型的混合型,这种混合型的流星体从未比常规的流星体慢过很多,同时大幅加快许多输入分布。