Ejemplo n.º 1
0
        /// <summary>
        /// Enter point of the project
        /// </summary>
        /// <param name="args">argument when launching project</param>
        static void Main(string[] args)
        {
            IBinaryTree <string> expression1 = TreeFactory.CreateArithmeticTree("0.5+35*97/63^3--21");

            foreach (Node <string> element in expression1)
            {
                Console.WriteLine(element.Data.ToString());
            }

            Console.WriteLine("--------------------------");
            Console.WriteLine("Answer : " + ((ArithmeticTree)expression1).SolveTree());
            Console.WriteLine("--------------------------");

            foreach (Node <string> element in expression1.Clone())
            {
                Console.WriteLine(element.Data.ToString());
            }

            Console.Write("\nPress a key to continue . . .");
            Console.ReadKey();
        }