예제 #1
0
        private static void Main()
        {
            var tree = new Random_Ordered_Tree();
            var rnd  = new Random();

            for (var i = 0; i < 10; i++)
            {
                var value = rnd.Next(1, 100);

                Console.WriteLine("Inserting {0}", value);
                tree.Insert(value);
            }

            var tree_path = tree.Traverse_tree(tree.root);

            Console.Write("Path: ");
            for (var i = 0; i < tree_path.Length; i++)
            {
                Console.Write("{0} ", tree_path[i]);
            }
        }
예제 #2
0
        static void Main(string[] args)
        {
            Random_Ordered_Tree tree = new Random_Ordered_Tree();
            Random rnd = new Random();

            for (int i = 0; i < 10; i++)
            {
                int value = rnd.Next(1, 100);

                Console.WriteLine("Inserting {0}", value);
                tree.insert(value);
            }

            int[] tree_path = tree.traverse_tree(tree.root);

            Console.Write("Path: ");
            for (int i = 0; i < tree_path.Length; i++)
            {
                Console.Write("{0} ", tree_path[i]);
            }
        }