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!