protected void zip(CompactTreeNode node) { if (node.child != null) { attachParent(node, join(node)); } else { layoutLeaf(node); } if (node.parent != null) { zip(node.parent); } }
/** * Laids out the specified tree node in the internal tree representation * * @param t * the node to be laid out */ protected void layout(CompactTreeNode t) { CompactTreeNode c; if (t == null) { return; } c = t.child; while (c != null) { layout(c); c = c.sibling; } if (t.child != null) { attachParent(t, join(t)); } else { layoutLeaf(t); } }