Описание тега hashset
HashSet<T>
was introduced in.NET Framework 3.5 as part of theSystem.Collections.Generic
namespace. HashSet is an unordered collection containing unique elements and provides a set of standard set operators such as intersection and union (plus many more). It has the standard collection operationsAdd
(although this method returns aBoolean
indicating whether or not that element already existed in the collection),Remove
, andContains
, but because it uses a hash-based implementation for object identity, these operations are immediately accessible without looping the entire list as occurs with theList<T>
collection for example (O(1) rather than O(n)).
Source: Linq to Objects using C# 4.0, Troy Magennis, Addison Wesley, 2010, Pearson Education Inc, ISBN-13: 978-0-321-63700-0