public Node(string value) { this.value = value; this.parent = null; this.children = new List<Node>() { }; this.isRoot = true; }
public Node CreateNode(string value) { Node node = new Node(value); if (mathsCalculator.DoOperation(node.value) > mathsCalculator.DoOperation(currentLocation.value)) { } }
public BinaryNode( Func<double, double, double> op, Node left, Node right) { this.Operator = op; this.Left = left; this.Right = right; }
public Node AssembleTree(List<string> equation) { Node node = new Node(equation[0]); currentLocation = node; }
public UnaryNode(Func<Double, double> op, Node inner) { this.Operator = op; this.Inner = inner; }
public object data;// 栈顶数据 public Node(Node sNext, object sData) { this.nextItem = sNext; this.data = sData; }
Node top;// 栈顶元素 public void Push(object data){ // 根据当前栈顶元素新构建一个新的栈顶,并将当前栈顶的NextItem指向原来的top top = new Node(top, data); }