X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=XMLTree.h;h=1268cb6b015c369e0bfdc87f7425879d8b88cc47;hb=63a9066c6cdd10751ba5e9142fc3341f50392688;hp=9b79ae3eab6040b473c0eb65473aabf4ea4836bd;hpb=deeb5434b7e061741700eff08588539d34b717a6;p=SXSI%2FXMLTree.git diff --git a/XMLTree.h b/XMLTree.h index 9b79ae3..1268cb6 100644 --- a/XMLTree.h +++ b/XMLTree.h @@ -153,6 +153,9 @@ public: /** IsChild(x,y): returns whether node x is parent of node y. */ bool IsChild(treeNode x, treeNode y); + + /** IsChild(x,y): returns whether node x is the first child of its parent */ + bool IsFirstChild(treeNode x); /** NumChildren(x): number of children of node x. Constant time with the * data structure of Sadakane. */ @@ -191,8 +194,13 @@ public: * Very fast in BP. */ treeNode FirstChild(treeNode x); + /** LastChild(x): returns the last child of node x. + * Implemented by Kim naively. */ + treeNode LastChild(treeNode x); + /** NextSibling(x): returns the next sibling of node x, assuming it * exists. */ + treeNode NextSibling(treeNode x); /** PrevSibling(x): returns the previous sibling of node x, assuming it