public bool Equals(SkipNode <TKey, TValue> otherNode) { NullSkipNode <TKey, TValue> otherNullNode = otherNode as NullSkipNode <TKey, TValue>; if (otherNullNode == null) { return(false); } return(true); }
private SkipList(double probable, int maxLevel) { Contract.Requires <ArgumentOutOfRangeException>(maxLevel > 0); Contract.Requires <ArgumentOutOfRangeException>(probable < 1); Contract.Requires <ArgumentOutOfRangeException>(probable > 0); this.probability = probable; this.maxLevel = maxLevel; level = 0; header = new SkipNode <TKey, TValue>(maxLevel); NullNode = new NullSkipNode <TKey, TValue>(maxLevel); //Initially all the forward links node of dummy header is NullNode for (int i = 0; i < maxLevel; i++) { header.Links[i] = NullNode; } }