コード例 #1
0
        public override string BinaryTree()
        {
            String temp = "\nnode" + this.Id + " [ label = \"^\" ][shape=polygon,sides=6,peripheries=3,color=lightpink,style=filled]\n";

            temp += "node" + this.Id + " -- node" + Operandleft.Id + "[style=dotted,color=purple]\n";
            temp += Operandleft.BinaryTree();
            temp += "node" + this.Id + " -- node" + Operandright.Id + "[shape=record,color=purple]\n";
            temp += Operandright.BinaryTree();
            return(temp);
        }
コード例 #2
0
        public override double Evaluate(double val)
        {
            double output = Math.Pow(Operandleft.Evaluate(val), Operandright.Evaluate(val));

            return(output);
        }
コード例 #3
0
        public override string ToPrefix()
        {
            string toprefixvalue = Operandleft.ToPrefix() + Operandright.ToPrefix();

            return(toprefixvalue);
        }