Template Class ChildListTree
Defined in File ChildListTree.h
Nested Relationships
Nested Types
Class Documentation
-
template<class T>
class ChildListTree an ordered tree whose nodes keep the list of their children
Public Functions
-
ChildListTree(void) = default
-
bool empty(void) const
-
int root(void) const
-
int parent(int n) const
- Pre:
n is a node
-
int leftmostChild(int n) const
- Pre:
n is a node
-
int rightSibling(int n) const
- Pre:
n is a node
-
bool isLeaf(int n) const
- Pre:
n is a node
-
bool isLastSibling(int n) const
whether n is the last of its siblings
- Pre:
n is a node
-
const List<int> &children(int n) const
the list of the children of n, in their order
- Pre:
n is a node
-
int size(void) const
-
int insertSibling(int n, const T &v)
a new next sibling of n, not the root, of value v
- Pre:
n is a node other than the root
-
void remove(int n)
removes the subtree of n, detached from its parent
- Pre:
n is a node
-
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
Public Static Attributes
-
static constexpr int NIL = -1
-
ChildListTree(void) = default