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); }
public override double Evaluate(double val) { double output = Math.Pow(Operandleft.Evaluate(val), Operandright.Evaluate(val)); return(output); }
public override string ToPrefix() { string toprefixvalue = Operandleft.ToPrefix() + Operandright.ToPrefix(); return(toprefixvalue); }