Template Class CursorTree
Defined in File CursorTree.h
Nested Relationships
Nested Types
Class Documentation
-
template<class T>
class CursorTree an ordered tree on a vector of nodes linked by their places
Public Functions
-
CursorTree(void) = default
-
bool empty(void) const
-
int root(void) const
-
int parent(int n) const
-
int leftmostChild(int n) const
-
int rightSibling(int n) const
-
bool isLeaf(int n) const
-
bool isLastSibling(int n) const
whether n is the last of its siblings
-
int size(void) const
-
int insertChildTree(int n, const CursorTree &t, int s)
a copy of the subtree of t in s as the first child of n; t may be this tree, copied as it was before the call
-
int insertSiblingTree(int n, const CursorTree &t, int s)
a copy of the subtree of t in s as the next sibling of n; t may be this tree, copied as it was before the call
-
void remove(int n)
removes the subtree of n, detached from its parent
-
std::vector<int> previsit(void) const
the nodes in previsit, postvisit, and invisit with index i
-
std::vector<int> postvisit(void) const
-
std::vector<int> invisit(int i) const
-
inline auto nodes(void) const
the nodes, in the order of their places, bidirectional
-
inline auto children(int n) const
the children of n, from the leftmost, forward
- Pre:
n is a node
Public Static Attributes
-
static constexpr int NIL = -1
-
struct Siblings
the walk of the children of a node
Public Static Functions
-
static inline int next(const CursorTree *o, int n, int)
-
static inline int next(const CursorTree *o, int n, int)
-
struct Used
the places in use, for SlotIterator
-
CursorTree(void) = default