Idempotent partition around median of 5?

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Fri Feb 5 17:58:41 PST 2016


On 02/06/2016 02:39 AM, Andrei Alexandrescu wrote:
> On 02/04/2016 03:30 PM, Timon Gehr wrote:
>> At most 6 comparisons, <=3 swaps, idempotent (optimal number of swaps):
>
> What is the minimum number of comparisons? Thx! -- Andrei

There is no partition algorithm that uses <= 5 comparisons in all cases.
(If that is what you're asking.)

> P.S. The sythesized searcher is genius.

Thanks!


More information about the Digitalmars-d mailing list