Пример #1
0
 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))
            {

            }

        }
Пример #3
0
 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;
 }
Пример #5
0
 public UnaryNode(Func<Double, double> op, Node inner)
 {
     this.Operator = op;
     this.Inner = inner;
 }
Пример #6
0
 public object data;// 栈顶数据
 public Node(Node sNext, object sData) {
     this.nextItem = sNext;
     this.data = sData;
 }
Пример #7
0
 Node top;// 栈顶元素          
 public void Push(object data){   
     // 根据当前栈顶元素新构建一个新的栈顶,并将当前栈顶的NextItem指向原来的top
     top = new Node(top, data);
 }