private HashNodeMap <TValue> CreateNode(TKey key, TValue value) { int hashCode = key.GetHashCode(); HashNodeMap <TValue> newNodeMap = new HashNodeMap <TValue> { data = new Node <TValue>(value), key = hashCode }; return(newNodeMap); }
public void Add(TKey key, TValue value) { if (hashNode == null) { hashNode = CreateNode(key, value); } else { HashNodeMap <TValue> current = hashNode; while (current.next != null) { current = current.next; } current.next = CreateNode(key, value); } Count++; }