public OpenAddressingHashTable(int capacity, ProbingType type = ProbingType.Linear) : base(capacity) { _elements = 0; Keys = new NullableArray<TKey>(capacity); Values = new DynamicArray<TValue>(capacity); switch(type) { case ProbingType.Linear: _probe = (x) => x * 17; break; case ProbingType.Quadratic: _probe = (x) => (x * x + x) >> 1; break; } }
public override void Clear() { Keys = new NullableArray<TKey>(_capacity); Values.Clear(); }