About 2,540,000 results
Open links in new tab
  1. .net - HashSet vs. List performance - Stack Overflow

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

  2. collections - What is the main difference between Hashset, Treeset and ...

    Switching to the difference between HashSet and LinkedHashSet, please note that LinkedHashSet is a subclass of HashSet. They are not sorted sets. HashSet is the fastest implementation of a set and it …

  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 (recommended) …

  4. 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 tables to...

  5. How to convert linq results to HashSet or HashedSet

    How to convert linq results to HashSet or HashedSet Asked 15 years, 4 months ago Modified 1 year, 11 months ago Viewed 129k times

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

    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.

  7. Easiest way to convert a List to a Set in Java - Stack Overflow

    Set<Integer> set5 = new HashSet<>(4); CollectionUtils.addAll(set5, sourceList); When we use Collectors.toSet() it returns a set and as per the doc: There are no guarantees on the type, …

  8. In which cases should I use a HashSet over a TreeSet?

    Java provides a LinkedHashSet, which is a HashSet with an "insertion-oriented" linked list running through it, that is, the last element in the linked list is also the most recently inserted into the Hash. …

  9. collections - What is the time complexity performance of HashSet ...

    It runs in O(1) expected time, as any hash table (assuming the hash function is decent). It is backed by a HashMap where the key is the Object. Two objects might have the same hash code, but the HashSet …

  10. How to initialize HashSet values by construction? - Stack Overflow

    Jan 11, 2010 · Yes I sometimes forget that contrary to other collections the HashSet, HashMap have a different constructor: "Constructs a new, empty set; the backing HashMap instance has the specified …