Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            int[] a = { 8, 4, 12, 2, 6, 10, 14 };

            ///////////////////////
            //         8         //
            //     /       \     //
            //    4        12    //
            //  /   \     /   \  //
            // 2     6   10   14 //
            ///////////////////////

            BST1 <int> bst = new BST1 <int>();

            for (int i = 0; i < a.Length; i++)
            {
                bst.Add(a[i]);
            }


            bst.PreOrder();



            Console.Read();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            int[] a = { 8, 4, 12, 2, 6, 10, 14 };

            ///////////////////////
            //         8         //
            //     /       \     //
            //    4        12    //
            //  /   \     /   \  //
            // 2     6   10   14 //
            ///////////////////////

            BST1 <int> bst = new BST1 <int>();

            for (int i = 0; i < a.Length; i++)
            {
                bst.Add(a[i]);
            }

            Console.WriteLine(bst.MaxHeight());


            Console.Read();
        }
Ejemplo n.º 3
0
 public BST1Set()
 {
     bst = new BST1 <E>();
 }