public void Add(string item) { LinkedString me = new LinkedString(item, null); int hashKey = (int)((uint)item.GetHashCode() % capacity); LinkedString currentAtHash = values[hashKey]; if (currentAtHash != null) { if (currentAtHash.nextValue != null) { currentAtHash = currentAtHash.nextValue; } currentAtHash.nextValue = me; } else { values[hashKey] = me; } }
public LinkedString(string myValue, LinkedString nextValue) { this.myValue = myValue; this.nextValue = nextValue; }