Ejemplo n.º 1
0
 //מקבלת עץ בינארי
 //מדפיסה את הצמתים שיש להם 2 בנים וערכם גדול מאחד מהם
 public static void BigFatherTwoSuns(BinTreeNode <int> t)
 {
     if (t != null)
     {
         if (t.GetLeft() != null && t.GetRight() != null)
         {
             if (t.GetInfo() > t.GetLeft().GetInfo() || t.GetInfo() > t.GetRight().GetInfo())
             {
                 Console.WriteLine(t.ToString());
                 //Console.WriteLine(t.GetInfo());
             }
         }
         BigFatherTwoSuns(t.GetLeft());
         BigFatherTwoSuns(t.GetRight());
     }
 }