// creates the data structure for the tree topology\r
Par = (bp *)umalloc(sizeof(bp));\r
STARTTIMER();\r
- bp_construct(Par, npar, (pb*) par, OPT_DEGREE|0);\r
+ bp_construct(Par, npar, (pb*) par, OPT_FAST_PREORDER_SELECT | OPT_DEGREE|0);\r
STOPTIMER(Building);\r
PRINTTIME("Building parenthesis struct", Building);\r
STARTTIMER();\r
else return NULLT;
};
+ inline treeNode NextNodeBefore(treeNode x, treeNode ancestor_closing)
+ {
+ treeNode close = fast_find_close(Par, x);
+ int rank = rank_open(Par, close);
+ treeNode y = select_open(Par, rank+1);
+ return (y < ancestor_closing) ? y : NULLT;
+ };
+
// TaggedSibling(x,tag): returns the first sibling of node x tagged tag, or NULLT if there is none.
treeNode TaggedFollowingSibling(treeNode x, TagType tag)
{