示例#1
0
  public static void main(String[] args) {
    IntNode d = new IntNode(5);
    d.setLeftNode(new IntNode(2));
    d.setRightNode(new IntNode(4));

    IntNode e = new IntNode(7);
    e.setLeftNode(new IntNode(-2));

    IntNode f = new IntNode(9);
    IntNode g = new IntNode(10);

    IntNode b = new IntNode(-6);
    b.setLeftNode(d);
    b.setRightNode(e);

    IntNode c = new IntNode(-3);
    c.setLeftNode(f);
    c.setRightNode(g);

    IntNode a = new IntNode(1);
    a.setLeftNode(b);
    a.setRightNode(c);

    printSums(a, 2);
  }