On 11/30/15 4:41 PM, H. S. Teoh via Digitalmars-d wrote:
What about when element i is matched, swap it with the (i/2)'th element?
Randomization is essential - without it you have thrashing if you search for 2 elements in alternation. -- Andrei
Andrei Alexandrescu via Digitalmars-d Mon, 30 Nov 2015 13:57:13 -0800
On 11/30/15 4:41 PM, H. S. Teoh via Digitalmars-d wrote:
What about when element i is matched, swap it with the (i/2)'th element?
Randomization is essential - without it you have thrashing if you search for 2 elements in alternation. -- Andrei