Exemplo n.º 1
0
        private void btnRecorrer_Click(object sender, EventArgs e)
        {
            int tamano = (r.Length) / 2;

            arreglo = r.Split(' ');

            ArbolBinarioOrdenado abo = new ArbolBinarioOrdenado();

            for (int i = 0; i < arreglo.Length - 1; i++)
            {
                abo.Insertar(Int32.Parse(arreglo[i]));
            }

            if (radioButton1.Checked == true)//En orden
            {
                preor = true;
                abo.PreOrden();
            }

            else if (radioButton2.Checked == true)//PreOrden
            {
                posor = true;
                abo.PostOrden();
            }
            else if (radioButton3.Checked == true)//Post-Orden
            {
                enor = true;
                abo.EnOrden();
            }
            Refresh();
            Refresh();
        }
Exemplo n.º 2
0
        private void btnRecorrer_Click(object sender, EventArgs e)
        {
            int tamano = (r.Length) / 2;

            //MessageBox.Show(r.Length.ToString());
            arreglo = r.Split(' ');

            //foreach (string word in arreglo)
            //{
            //    MessageBox.Show(word);
            //}

            ArbolBinarioOrdenado abo = new ArbolBinarioOrdenado();

            for (int i = 0; i < arreglo.Length - 1; i++)
            {
                abo.Insertar(Int32.Parse(arreglo[i]));
            }



            if (radioButton1.Checked == true)//En orden
            {
                enor = true;
                abo.EnOrden();
                label5.Text = "En orden:  " + abo.en_orden;
            }

            else if (radioButton2.Checked == true)//PreOrden
            {
                preor = true;
                abo.PreOrden();
                label5.Text = "pre orden:  " + abo.pre_orden;
            }
            else if (radioButton3.Checked == true)//Post-Orden
            {
                posor = true;
                abo.PostOrden();
                label5.Text = "post orden:  " + abo.post_orden;
            }
            Refresh();
            Refresh();
        }
Exemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            int tamano = (r.Length) / 2;

            //MessageBox.Show(r.Length.ToString());
            arreglo = r.Split(' ');

            //foreach (string word in arreglo)
            //{
            //    MessageBox.Show(word);
            //}

            ArbolBinarioOrdenado abo = new ArbolBinarioOrdenado();

            for (int i = 0; i < arreglo.Length - 1; i++)
            {
                abo.Insertar(Int32.Parse(arreglo[i]));
            }
            abo.EnOrden();
        }