static void ImprimirABB() { ArbolBinarioOrdenado abo = new ArbolBinarioOrdenado(); abo.Insertar(120); abo.Insertar(87); abo.Insertar(140); abo.Insertar(43); abo.Insertar(99); abo.Insertar(1000); Console.WriteLine("Impresion preorden: "); abo.ImprimirPre(); Console.WriteLine("Impresion entreorden: "); abo.ImprimirEntre(); Console.WriteLine("Impresion postorden: "); abo.ImprimirPost(); }
static void Main(string[] args) { ArbolBinarioOrdenado abo = new ArbolBinarioOrdenado(); abo.Insertar(100); abo.Insertar(50); abo.Insertar(25); abo.Insertar(75); abo.Insertar(150); Console.WriteLine("Impresion preorden: "); abo.ImprimirPre(); Console.WriteLine("Impresion entreorden: "); abo.ImprimirEntre(); Console.WriteLine("Impresion postorden: "); abo.ImprimirPost(); Console.ReadKey(); }
static void Main(string[] args) { ArbolBinarioOrdenado abo = new ArbolBinarioOrdenado(); abo.Insertar(100); abo.Insertar(50); abo.Insertar(25); abo.Insertar(75); abo.Insertar(150); Console.WriteLine("Entreorden: "); abo.ImprimirEntre(); Console.WriteLine("Canntidad de nodos del árbol:" + abo.Cantidad()); Console.WriteLine("Cantidad de nodos hoja:" + abo.CantidadNodosHoja()); Console.WriteLine("Entre orden junto al nivel del nodo."); abo.ImprimirEntreConNivel(); Console.Write("Altura del arbol:"); Console.WriteLine(abo.RetornarAltura()); abo.MayorValorl(); abo.BorrarMenor(); Console.WriteLine("Borrar el menor:"); abo.ImprimirEntre(); Console.ReadKey(); }
public MainPage() { edit = new Editor(); arbole = new ArbolBinarioOrdenado(edit); this.L = 1; this.c = 0; entry = new Entry(); grid = new Grid(); Stack = new StackLayout(); Title = "Code Button Click"; this.label = new Label(); this.label.Text = "Click"; this.label.FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)); Button button = new Button { Text = "Insertar", }; button.Clicked += async(sender, args) => Cambio(); Button button1 = new Button { Text = "preOrder", }; button1.Clicked += async(sender, args) => Cambio1(); Button button2 = new Button { Text = "InOrder", }; button2.Clicked += async(sender, args) => Cambio2(); Button button3 = new Button { Text = "PosOrder", }; button3.Clicked += async(sender, args) => Cambio3(); Label lab = new Label(); lab.Text = "he"; grid.ColumnDefinitions.Add(new ColumnDefinition()); grid.ColumnDefinitions.Add(new ColumnDefinition()); grid.Children.Add(label); grid.Children.Add(lab, 1, 0); Stack.Children.Add(entry); Stack.Children.Add(button); Stack.Children.Add(button1); Stack.Children.Add(button2); Stack.Children.Add(button3); Stack.Children.Add(grid); Stack.Children.Add(edit); Content = Stack; // InitializeComponent(); }