static bool Foo2(BinNode<char> t) { if(t != null) { if(t.GetLeft().HasLeft() || t.GetLeft().HasRight()) } }
static bool IsTreePele(BinNode<int> t) { bool bRight = true, bLeft = true; //check if t.GetRight() and t.GetLeft() are "Elime" if (t.GetRight().GetRight() == null && t.GetRight().GetLeft() == null && t.GetLeft().GetRight() == null && t.GetLeft().GetLeft() == null) { if (!IsGood(t)) return false; } else { if (t.GetRight() != null) { bRight = IsTreePele(t.GetRight()); } if (t.GetLeft() != null) { bLeft = IsTreePele(t.GetLeft()); } return true == bRight == bLeft; } return true; }
static bool Foo1(BinNode<char> t) { if(t != null) { if(t.GetLeft() != null && t.GetRight() != null) if } }
static bool IsGood(BinNode<int> t)//Check if the number of the two "Elime" and the "Father" is "< 10" { if (t.GetRight().GetValue() < 10 && t.GetLeft().GetValue() < 10 && t.GetValue() < 10) { return true; } return false; }
public void SetRight(BinNode <T> right) { this.right = right; }
public void SetLeft(BinNode <T> left) { this.left = left; }
public BinNode(BinNode <T> left, T value, BinNode <T> right) { this.value = value; this.left = left; this.right = right; }
public BinNode(T value) { this.value = value; this.left = null; this.right = null; }