projects
/
SXSI
/
XMLTree.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added IsFirstChild and LastChild
[SXSI/XMLTree.git]
/
XMLTree.h
diff --git
a/XMLTree.h
b/XMLTree.h
index
9b79ae3
..
1268cb6
100644
(file)
--- a/
XMLTree.h
+++ b/
XMLTree.h
@@
-153,6
+153,9
@@
public:
\r
/** IsChild(x,y): returns whether node x is parent of node y. */
\r
bool IsChild(treeNode x, treeNode y);
\r
\r
/** IsChild(x,y): returns whether node x is parent of node y. */
\r
bool IsChild(treeNode x, treeNode y);
\r
+
\r
+ /** IsChild(x,y): returns whether node x is the first child of its parent */
\r
+ bool IsFirstChild(treeNode x);
\r
\r
/** NumChildren(x): number of children of node x. Constant time with the
\r
* data structure of Sadakane. */
\r
\r
/** NumChildren(x): number of children of node x. Constant time with the
\r
* data structure of Sadakane. */
\r
@@
-191,8
+194,13
@@
public:
* Very fast in BP. */
\r
treeNode FirstChild(treeNode x);
\r
\r
* Very fast in BP. */
\r
treeNode FirstChild(treeNode x);
\r
\r
+ /** LastChild(x): returns the last child of node x.
\r
+ * Implemented by Kim naively. */
\r
+ treeNode LastChild(treeNode x);
\r
+
\r
/** NextSibling(x): returns the next sibling of node x, assuming it
\r
* exists. */
\r
/** NextSibling(x): returns the next sibling of node x, assuming it
\r
* exists. */
\r
+
\r
treeNode NextSibling(treeNode x);
\r
\r
/** PrevSibling(x): returns the previous sibling of node x, assuming it
\r
treeNode NextSibling(treeNode x);
\r
\r
/** PrevSibling(x): returns the previous sibling of node x, assuming it
\r