TreeSet

Koroskin Denis 2korden at gmail.com
Sat Aug 2 16:15:28 PDT 2008


On Sun, 03 Aug 2008 03:00:35 +0400, Toki <thorstenkiefer at gmx.de> wrote:

> Benji Smith Wrote:
>
>> > sorry I meant you can use an associative array with a boolean dummy
>> > value, e.g.:
>> > bool[uint] myset;
>>
>> It's not *quite* the same.
>>
>> A java TreeSet<T> uses a red-black tree implementation rather than a
>> hashtable implementation (like the java HashSet<T> class). Consequently,
>> a TreeSet<T>.ValueIterator will always iterate the values in their
>> natural ordering, whereas a HashSet<T>.ValueIterator makes no guarantees
>> about its iteration ordering.
>>
>> I don't know whether Tango provides any equivalent containers. Tango
>> definitely has TreeMap and TreeBag implementations, but there doesn't
>> seem to be a TreeSet.
>>
>> http://dsource.org/projects/tango/docs/current/
>>
>> Someone with more Tango expertise could probably clarify...
>>
>> --benji
>
> Thnak you,
> that's what I was looking for.
> But the next question: is tango available for dmd, or only for gdc ?
>
> -Toki

It is available for both.



More information about the Digitalmars-d mailing list