public double CalcProb(HashSet <String> set) { if (Name == null) { return(Weight); } else { if (set.Contains(Name)) { return(Weight * LeftChild.CalcProb(set)); } else { return(Weight * RightChild.CalcProb(set)); } } }
public double CalcProb(HashSet <String> set) { if (Name == null) { return(Weight); } else { if (set.Contains(Name)) { return(Weight * LeftChild.CalcProb(set)); } else { return(Weight * RightChild.CalcProb(set)); } } }