示例#1
0
 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();
     }
 }
示例#2
0
 public override int GetHashCode()
 {
     return(left.GetHashCode() ^ item.GetHashCode() ^ right.GetHashCode());
 }