Sommaire

Les tables de hachage

1. Introduction

En C#, on utilise la classe HashSet qui se trouve également dans l’espace de noms System.Collections.Generic

[DebuggerDisplay("Count = {Count}")]  
[DebuggerTypeProxy(typeof(Generic.HashSetDebugView<>))]  
public class HashSet<T> : ISerializable, IDeserializationCallback,  
ISet<T>, ICollection<T>, IEnumerable<T>, IEnumerable  
{  
  public HashSet();  
  public HashSet(IEqualityComparer<T> comparer);  
  public HashSet(IEnumerable<T> collection);  
  public HashSet(IEnumerable<T> collection, IEqualityComparer<T> comparer); 
  protected HashSet(SerializationInfo info, StreamingContext context);  
  
  public int Count { get; }  
  public IEqualityComparer<T> Comparer { get; }  
  
  public static IEqualityComparer<HashSet<T>> CreateSetComparer();  
  public bool Add(T item);  
  public void Clear();  
  public bool Contains(T item);  
  public void CopyTo(T[] array, int arrayIndex);  
  public void CopyTo(T[] array, int arrayIndex, int count);  
  public void CopyTo(T[] array);  
  public void ExceptWith(IEnumerable<T> other);  
  public Enumerator GetEnumerator();  
  [SecurityCritical]  
  public void IntersectWith(IEnumerable<T> other);  
  public bool IsProperSubsetOf(IEnumerable<T> other);  
  public bool IsProperSupersetOf(IEnumerable<T> ...