public void Add(K key, V value) { CuckooPair <K, V> add = new CuckooPair <K, V>(key, value); int index = GetIndex(key); if (table[index].Equals(default(CuckooPair <K, V>))) { table[index] = add; } else { CuckooPair <K, V> other = table[index]; table[index] = add; this.Add(other.key, other.value); } }
public override bool Equals(object obj) { CuckooPair <K, V> other = (CuckooPair <K, V>)obj; return(this.key.Equals(other.key)); }