public BinaryTree(IBinaryTree <V> left, V value, IBinaryTree <V> right) : this() { myLeft = left ?? theEmpty; myValue = value; myRight = right ?? theEmpty; myIsLeaf = myLeft.IsEmpty && myRight.IsEmpty; unchecked { myHashCode += myLeft.GetHashCode(); if (!System.Object.ReferenceEquals(null, value)) { myHashCode += value.GetHashCode(); } myHashCode += myRight.GetHashCode(); } }
public override int GetHashCode() { return(left.GetHashCode() ^ item.GetHashCode() ^ right.GetHashCode()); }