Template Class CursorBinaryTree
Defined in File CursorBinaryTree.h
Nested Relationships
Nested Types
Class Documentation
-
template<class T>
class CursorBinaryTree a binary tree on a vector of nodes linked by their places
Public Functions
-
CursorBinaryTree(void) = default
-
bool empty(void) const
-
int root(void) const
-
int parent(int n) const
-
int left(int n) const
-
int right(int n) const
-
bool isLeaf(int n) const
-
int size(void) const
the number of nodes
-
int insertLeft(int n, const CursorBinaryTree &t, int s)
a copy of the subtree of t in s as the left subtree of n; t may be this tree, copied as it was before the call
-
int insertRight(int n, const CursorBinaryTree &t, int s)
a copy of the subtree of t in s as the right subtree 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> preorder(void) const
the nodes in preorder
-
inline auto nodes(void) const
the nodes, in the order of their places, bidirectional
Public Static Attributes
-
static constexpr int NIL = -1
-
struct Used
the places in use, for SlotIterator
-
CursorBinaryTree(void) = default