public int SumMinValue() { if (mMinValue == int.MaxValue) { if (mLeftChild != null && mRightChild != null) { mMinValue = mValue + Math.Min(mLeftChild.SumMinValue(), mRightChild.SumMinValue()); } else if (mLeftChild != null) { mMinValue = mValue + mLeftChild.SumMinValue(); } else if (mRightChild != null) { mMinValue = mValue + mRightChild.SumMinValue(); } else { mMinValue = mValue; } } return(mMinValue); }
public int SumMinValue() { return(mRoot.SumMinValue()); }