Esempio n. 1
0
 static void Main(string[] args)
 {
     Console.WriteLine("Ingresa la raiz del arbol");
     int b = RecibirNumero();
     Arbol.Arbol A = new Arbol.Arbol(b);
     int c = 0;
     while (c < 9)
     {
         Console.WriteLine("Ingrese el siguiente hijo");
         b = RecibirNumero();
         A.Insertar(b);
         c++;
     }
     Console.WriteLine("Ingrese el dato a eliminar");
     b = RecibirNumero();
     A.Eliminar(b);
 }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Ingresa la raiz del arbol");
            int b = RecibirNumero();

            Arbol.Arbol A = new Arbol.Arbol(b);
            int         c = 0;

            while (c < 9)
            {
                Console.WriteLine("Ingrese el siguiente hijo");
                b = RecibirNumero();
                A.Insertar(b);
                c++;
            }
            Console.WriteLine("Ingrese el dato a eliminar");
            b = RecibirNumero();
            A.Eliminar(b);
        }
Esempio n. 3
0
 public MainWindow()
 {
     InitializeComponent();
     Ar = new Arbol.Arbol();
 }
Esempio n. 4
0
 private void DibujarNodo(Arbol.Arbol.Nodo Nd, double Top, double Left)
 {
     if (Nd != null)
     {
         Grid Holder = new Grid
         {
             Width = 50.0,
             Height = 50.0
         };
         Ellipse Elp = new Ellipse
         {
             Fill = new SolidColorBrush(Colors.Aqua)
         };
         Holder.Children.Add(Elp);
         TextBlock Txt = new TextBlock
         {
             Text = Nd.inf.ToString(),
             Width = 35.0,
             Height = 35.0,
             TextAlignment = TextAlignment.Center,
             VerticalAlignment = VerticalAlignment.Center,
             Padding = new Thickness(0.0, 8.0, 0.0, 0.0)
         };
         Holder.Children.Add(Txt);
         Holder.SetValue(Canvas.TopProperty, Top);
         Holder.SetValue(Canvas.LeftProperty, Left);
         this.Canvas.Children.Add(Holder);
         this.DibujarNodo(Nd.izq, Top + 50.0, Left - 50.0);
         this.DibujarNodo(Nd.der, Top + 50.0, Left + 50.0);
     }
 }
Esempio n. 5
0
 public MainWindow()
 {
     InitializeComponent();
     Ar = new Arbol.Arbol();
 }