Library help: a set class needed

Hi

I need som tips about finding a library that is implements som sort of a set datatype. That is a collection where all members are unique.

Something like the Java languages Hashset implementation:
http://java.sun.com/j2se/1.5.0/docs/api/java/util/HashSet.html

Thanks

Regards



Answer this question

Library help: a set class needed

  • project2n5e0o1

    .Net Framework have HashTable Class you can look at it

    http://msdn2.microsoft.com/en-us/library/system.collections.hashtable.aspx



  • Dead_Zone

    No, it's still not what I'm looking for.

    The Java Hashset does not collect it items through a key/value pair, just values that are unique to each other. It bases its unique list by using a hash in some way (I'm not shure about exactly how), but probably not the most efficient implementation.

    The meaning behind a Set is described here in the first paragraph of the Java API:
    http://java.sun.com/j2se/1.5.0/docs/api/java/util/Set.html


    What about something similar to :
    http://java.sun.com/j2se/1.5.0/docs/api/java/util/TreeSet.html ( )


    The C# and Java Hashset share just the name. (However I think it's a misleading name in the Java API). I aplogize for using hashset as an example, as it might have been confusing.


  • Mike Howes

    "The C# and Java Hashset share just the name."

    C# doesn't have a Hashset (or any set implementation), it has a Hashtable. One can easily implement their own set class, however, by using a Hashtable internally to track what items have been added to the set and prevent duplicates from being added a second time. This how the Hashset class in java works. The name isn't misleading. Its says exactly what it is. Its a set that is implemented internally using a hashtable or similar hashing scheme. As the other poster suggested, the Power Collections being developed for .NET 2.0 by 3rd parties may have what you're looking for.


  • Waltari

    i don't think microsoft added this support for .NET 2.0 but for 1.1 we are using Iesi.Collections from this project (http://www.codeproject.com/csharp/sets.asp).

    you might also want to checkout the PowerCollections


  • Library help: a set class needed