topN using a heap

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Tue Jan 19 16:39:55 PST 2016


On 01/19/2016 01:27 PM, Timon Gehr wrote:
> On 01/19/2016 04:33 PM, Andrei Alexandrescu wrote:
>> On 01/19/2016 08:10 AM, Andrei Alexandrescu wrote:
>>> So anyhow we need the "intro" part. I'll get to that soon.
>>
>> Destroy! I made it part of
>> https://github.com/D-Programming-Language/phobos/pull/3934.
>>
>> https://github.com/andralex/phobos/commit/4ba95cd1bd5124b53324c441e62c51d759481b04
>>
>> ...
>
> The switching heuristic is bad. It always switches after at most 8 steps.

My algebra is completely rotten. Thanks! Updated 
https://github.com/andralex/phobos/commit/cdd59b51a397ee1a4584e55c07d921c59acb5978.


Andrei


More information about the Digitalmars-d mailing list