98 static constexpr std::size_t
nil = std::size_t( -1 );
126 explicit BPTree(
const std::vector< std::vector< std::size_t > > & c );
133 [[nodiscard]] std::size_t
size(
void )
const;
136 [[nodiscard]] std::size_t
root(
void )
const;
150 [[nodiscard]] std::size_t
parent( std::size_t v )
const;
176 [[nodiscard]] std::size_t
degree( std::size_t v )
const;
187 [[nodiscard]] std::size_t
depth( std::size_t v )
const;
192 [[nodiscard]]
bool isAncestor( std::size_t u , std::size_t v )
const;
196 [[nodiscard]]
bool isLeaf( std::size_t v )
const;
214 [[nodiscard]] std::size_t open( std::size_t v )
const;
228#include "ADS/succinct/impl/BPTree.tpp"
A static sequence of balanced parentheses, 1 for an open one and 0 for a closed one,...
The vector of bits on which the succinct structures and the integer codes of ADS are built: the bits ...
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
std::size_t degree(std::size_t v) const
the number of children of , by a walk along them with leftmostChild() and rightSibling()
std::size_t depth(std::size_t v) const
the edges from the root to , the excess at its open parenthesis less 1
std::size_t size(void) const
the number of nodes
bool isLeaf(std::size_t v) const
whether has no children
BPTree(const std::vector< std::vector< std::size_t > > &c)
the tree whose node has the children , in order, rooted at 0
static constexpr std::string_view persistName
the name of the structure in a file [see Persistence.h]
Definition BPTree.h:204
std::size_t leftmostChild(std::size_t v) const
the first child of , nil for a leaf, which is when an open parenthesis follows that of
void persist(A &a)
the members written to, or read from, the archive [see Persistence.h]
BPTree(void)=default
the empty tree
std::size_t subtreeSize(std::size_t v) const
the nodes of the subtree of , included, as for the open parenthesis of
bool isAncestor(std::size_t u, std::size_t v) const
whether is or one of its ancestors, i.e., whether
static constexpr std::size_t nil
no node
Definition BPTree.h:98
std::size_t rightSibling(std::size_t v) const
the next sibling of , nil for the last one
std::size_t parent(std::size_t v) const
the parent of , nil for the root
const BalancedParentheses & parentheses(void) const
the parentheses, with their matching
std::size_t root(void) const
the root, nil if the tree is empty
BPTree(BitVector b)
the tree whose parentheses are
a static sequence of balanced parentheses with a range min-max tree
Definition BalancedParentheses.h:124
a vector of bits packed in words of 64 bits
Definition BitVector.h:479