X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=xml-tree.hpp;fp=xml-tree.hpp;h=aba316068a15747980a9c64ab4ab20c71c183de9;hb=a48601dcbcddb424105024b41d85f724021ea787;hp=8d4af6ae0fba3f37f627daf858e8c31749585ea4;hpb=01c39298054f3d532fca0ab704c8ddbb4de02450;p=SXSI%2FXMLTree.git diff --git a/xml-tree.hpp b/xml-tree.hpp index 8d4af6a..aba3160 100644 --- a/xml-tree.hpp +++ b/xml-tree.hpp @@ -142,8 +142,23 @@ public: inline bool is_open(node_t) const; //Numbering functions + /** + * [depth(n)] returns the depths of node [n]. The root has depth 1. + * Runs in O(1) + */ uint32_t depth(node_t) const; + + /** + * [preorder(n)] returns the preorder of node [n]. Equivalent to calling + * rank on the underlying BP representation. + * Runs in O(1) + */ uint32_t preorder(node_t) const; + + /** + * [preorder(n)] returns the postorder of node [n]. + * Runs in O(1) + */ uint32_t postorder(node_t) const; //Tag functions