public int Height() { // get // { int leftHeight = LeftChild == null ? 0 : LeftChild.Height(); int rightHeight = RightChild == null ? 0 : RightChild.Height(); return(Math.Max(leftHeight, rightHeight) + 1); //if (ChildCount == 0) //{ // return 1; //} //if (LeftChild.Height > RightChild.Height) //{ // return LeftChild.Height + 1; //} //return RightChild.Height + 1; // } }
void UpdateHeight(Node <T> node) { int temp = node.Height(); }