Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            var avl = new AVL <int>();

            //TODO: test preOrder, finish inOrder and post order

            avl.Insert(50);
            avl.Insert(25);
            avl.Insert(75);
            avl.Insert(30);

            var list = avl.breadthFirst();

            for (int a = 0; a < list.Count; a++)
            {
                Console.WriteLine(list[a]);
            }
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            AVL b = new AVL();

            b.Add(4);
            b.Add(5);
            b.Add(3);
            b.Add(23);
            b.Add(87);
            b.Add(54);
            b.Add(5);
            b.DisplayTree();
            Console.WriteLine();

            b.Delete(5);
            b.DisplayTree();
            Console.WriteLine();

            b.Find(23);
            b.DisplayTree();
            Console.WriteLine();
        }