using a binary tree container

spir denis.spir at gmail.com
Fri Feb 11 10:35:02 PST 2011


On 02/11/2011 06:55 PM, spir wrote:
> On 02/11/2011 01:30 PM, Dominic Jones wrote:
>> == Quote from bearophile (bearophileHUGS at lycos.com)'s article
>>> Dominic Jones:
>>>> I have a list of strings and I want to determine whether or not a particular
>>>> string in the is in that list.
>>> What about using:
>>> size_t[sting] yourStringSet;
>>> Bye,
>>> bearophile
>>
>> Would that not be constructing an associated array? Whilst an associated array
>> would do the job, there is no value for the "key:value" pair, just a list of
>> keys.
>> In the C++ STL there are the "set" and "map" containers. I want something
>> like "set".
>> Dominic

By the way, i may be wrong on that, but D's builtin AAs seem /very/ fast on key 
access. You'd probably have a hard time even approaching their performance 
using whatever kind of tree (or rather, of trie). I tried ;-) Both with string 
and bit-seq keys (in the latter case, thus using a bit-trie). If ever you have 
any good result on this path, I am very interested.

denis
-- 
_________________
vita es estrany
spir.wikidot.com



More information about the Digitalmars-d-learn mailing list