Ejemplo n.º 1
0
 public virtual Node buildTree()
 {
     n11 = new Node(); // Node-0
     n12 = new Node(); // Node-1
     n1  = new Node(new Node[]{n11,n12}); // Node-2
     n2  = new Node(); // Node-3
     n0  = new Node(new Node[]{n1,n2}); // Node-4
     return n0;
 }
Ejemplo n.º 2
0
 public abstract Node visitNode(Node x);
Ejemplo n.º 3
0
 /**
  * Create a new node with given kids. Each created node will have
  * a different nodeID.
  */
 public static Node factory(Node[] kids)
 {
     Node result = new Node(kids, nodeCounter);
     nodeCounter++;
     return result;
 }
Ejemplo n.º 4
0
 public Node(Node[] kids)
 {
     this.kids = kids;
     this.nodeID = nodeCounter++;
 }
Ejemplo n.º 5
0
 public Node(Node[] kids, int nodeID)
 {
     this.kids = kids;
     this.nodeID = nodeID;
 }
Ejemplo n.º 6
0
 internal virtual void buildDiamond()
 {
     Node sink = new Node();
     rootOfDiamond = new Node(new Node[]{sink,sink});
 }
Ejemplo n.º 7
0
 internal virtual void buildCircle()
 {
     Node node = new Node(new Node[]{null});
     rootOfCircle = new Node(new Node[]{node});
     node.setChildAt(0,rootOfCircle);
 }
Ejemplo n.º 8
0
 protected override void SetUp()
 {
     Node.reset();
     Node[] empty = {};
     logger = new Logger();
     n0 = Node.factory(empty);
     n1 = Node.factory(empty);
     n2 = Node.factory(empty);
     n3 = Node.factory(new Node[]{n0,n1});
     n4 = Node.factory(new Node[]{n3,n2});
 }