Quantcast
Channel: C# Set collection? - Stack Overflow
Browsing latest articles
Browse All 8 View Live

Answer by Derek W for C# Set collection?

If you're using .NET 4.0 or later:In the case where you need sorting then use SortedSet<T>. Otherwise if you don't, then use HashSet<T> since it's O(1) for search and manipulate operations....

View Article



Answer by Bob Heck for C# Set collection?

I know this is an old thread, but I was running into the same problem and found HashSet to be very unreliable because given the same seed, GetHashCode() returned different codes. So, I thought, why not...

View Article

Answer by thecoop for C# Set collection?

I use a wrapper around a Dictionary<T, object>, storing nulls in the values. This gives O(1) add, lookup and remove on the keys, and to all intents and purposes acts like a set.

View Article

Answer by dpan for C# Set collection?

Have a look at Power Collections. Apart from Set and OrderedSet it has a few other usefull collection types such as Deque, MultiDictionary, Bag, OrderedBag, OrderedDictionary and...

View Article

Answer by Chris Canal for C# Set collection?

I use Iesi.Collections http://www.codeproject.com/KB/recipes/sets.aspxIt's used in lot of OSS projects, I first came across it in NHibernate

View Article


Answer by Jon Skeet for C# Set collection?

If you're using .NET 3.5, you can use HashSet<T>. It's true that .NET doesn't cater for sets as well as Java does though.The Wintellect PowerCollections may help too.

View Article

Answer by Leahn Novash for C# Set collection?

Try HashSet:The HashSet(Of T) class provides high-performance set operations. A set is a collection that contains no duplicate elements, and whose elements are in no particular order...The capacity of...

View Article

C# Set collection?

Does anyone know if there is a good equivalent to Java's Set collection in C#? I know that you can somewhat mimic a set using a Dictionary or a HashTable by populating but ignoring the values, but...

View Article

Browsing latest articles
Browse All 8 View Live




Latest Images