About 5,170,000 results
Open links in new tab
  1. c# - Define: What is a HashSet? - Stack Overflow

    Dec 30, 2010 · HashSet is an unordered collection containing unique elements. It has the standard collection operations Add, Remove, Contains, but since it uses a hash-based …

  2. How can `HashSet<T>.Contains` be O(1) with this implementation?

    Okay, so how "search complexity in hashset is O (1)"? It's not. The worst case complexity is proportional to the number of items. It's O (1) on average.2 If all objects fall to the same …

  3. Concurrent HashSet<T> in .NET Framework? - Stack Overflow

    Your implementation is correct. The .NET Framework does not provide a built-in concurrent hashset type, unfortunately. However, there are some workarounds. ConcurrentDictionary …

  4. What is the difference between HashSet<T> and List<T>?

    Jun 18, 2011 · A HashSet<T> is a class designed to give you O(1) lookup for containment (i.e., does this collection contain a particular object, and tell me the answer fast). A List<T> is a …

  5. .net - HashSet vs. List performance - Stack Overflow

    It's clear that a search performance of the generic HashSet&lt;T&gt; class is higher than of the generic List&lt;T&gt; class. Just compare the hash-based key with the linear approach in the …

  6. How does HashSet compare elements for equality? - Stack Overflow

    Jan 21, 2012 · How does HashSet compare elements for equality? Asked 13 years, 9 months ago Modified 1 year, 5 months ago Viewed 136k times

  7. What's the difference between HashSet and Set? - Stack Overflow

    Apr 16, 2016 · 1 HashSet is a class derived from Set interface. As a derived class of Set, the HashSet attains the properties of Set. Important and the most frequently used derived classes …

  8. Collection that allows only unique items in .NET?

    The HashSet<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.

  9. Difference between HashSet and HashMap? - Stack Overflow

    Apart from the fact that HashSet does not allow duplicate values, what is the difference between HashMap and HashSet in their implementation? It's a little bit vague because both use hash …

  10. c# - Make HashSet<string> case-insensitive - Stack Overflow

    The HashSet<T> constructor has an overload that lets you pass in a custom IEqualityComparer<string>. There are a few of these defined for you already in the static …