private void GenerateEmptyArray() { tables = new LPItem <Key, Value> [size]; for (int i = 0; i < tables.Length; i++) { tables[i] = new LPItem <Key, Value>(); } }
public void Add(Key p_key, Value p_value) { var hash = GetHashCode(p_key); for (int i = hash; ; i = (i + 1) % size) { if (tables[i].IsEmpty) { tables[i] = new LPItem <Key, Value>(p_key, p_value); number++; if (number > size / 2) { Resize(2 * size); } return; } else if (tables[i].key.Equals(p_key)) { tables[i].value = p_value; } } }