コード例 #1
0
 public static void AddBrother(BinTreeNode <int> S)
 {
     if (S.GetLeft() != null && S.GetRight() != null)
     {
         if (S.GetLeft() == null)
         {
             BinTreeNode <int> LeftB = new BinTreeNode <int>(0);
             S.SetLeft(LeftB);
         }
         if (S.GetRight() == null)
         {
             BinTreeNode <int> RightB = new BinTreeNode <int>(0);
             S.SetLeft(RightB);
         }
         AddBrother(S.GetLeft());
         AddBrother(S.GetRight());
     }
 }