public static BuchheimNode Layout(BuchNodeWrapper tree) { var dt = firstwalk(new BuchheimNode(tree)); var min = second_walk(dt); if (min.HasValue && min < 0) { third_walk(dt, -min.Value); } return(dt); }
public BuchheimNode(BuchNodeWrapper node, BuchheimNode parent = null, int depth = 0, int number = 1) { this.x = -1; this.y = depth; this.node = node; this.children = node .Select((c, i) => new BuchheimNode(c, this, depth + 1, i + 1)) .ToArray(); this.parent = parent; this.thread = null; this.mod = 0; this.ancestor = this; this.change = 0; this.shift = 0; this._lmost_sibling = null; this.number = number; }