dcollections 1.0 and 2.0a beta released

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon May 24 14:35:11 PDT 2010


On 05/24/2010 04:08 PM, Steven Schveighoffer wrote:
> On Mon, 24 May 2010 16:27:46 -0400, Andrei Alexandrescu
> <SeeWebsiteForEmail at erdani.org> wrote:
>
>> Sorry. Yes, by-key iteration should be possible.
>
> OK, so we should be able to iterate keys. And the keys are not stored in
> the trie structure itself. So how does one iterate the keys of the
> container without reconstructing them from the trie nodes using the
> heap?

You can't. At some point you need to copy tree traces into T[] arrays. 
If the trie stores parent nodes, you don't need to do that as you can 
expose a trace as a double-ended range containing the key.

There's a kind of trie that was defined to avoid such issues; it stores 
the keys in clear, in the leaves, at the expense of duplication. I don't 
remember the name offhand. Does anyone?


Andrei



More information about the Digitalmars-d-announce mailing list