Пример #1
0
 public override void RemoveRedundantNodes()
 {
     if (FirstChild == null && SecondChild != null)
     {
         ReplaceThisWith(SecondChild);
     }
     else if (SecondChild == null && FirstChild != null)
     {
         ReplaceThisWith(FirstChild);
     }
     else if (FirstChild == null && SecondChild == null)
     {
         Parent?.RemovePlacement(this);
     }
     FirstChild?.RemoveRedundantNodes();
     SecondChild?.RemoveRedundantNodes();
 }