|
template<class TREEITER > |
bool | Init (TREEITER &root, uint32_t num_nodes) noexcept |
| Generates a parentheses representation of a tree from the tree object. More...
|
|
int | ToNodeId (uint32_t pos) const noexcept |
| Gets the node ID from the bit array position. More...
|
|
int | ToPos (uint32_t nodeid) const noexcept |
| Gets Bit array position from the node ID. More...
|
|
size_t | MemSize () const noexcept |
| Returns the amount of memory explicitly allocated by the class. More...
|
|
void | Reset () noexcept |
| Returns the object to the state immediately after the constructor is called.
|
|
|
| Bp () noexcept |
| Instantiates the object.
|
|
| ~Bp () noexcept |
| Destructor.
|
|
Bp & | assign (Bp &rhs, move_tag) |
| Assigns the object by using swap for a move.
|
|
| Bp (Bp &rhs, move_tag) |
| Instantiates the object by using swap for a move.
|
|
| Bp (Bp &&rhs) |
| Instantiates the object (move constructor). This function is useful when using C++11.
|
|
Bp & | operator= (Bp &&rhs) |
| Move assignment operator. This function is useful when using C++11.
|
|
void | swap (Bp &rhs) noexcept |
| Swaps the contents of an object.
|
|
|
int | FindOpen (uint32_t pos) const noexcept |
| Gets the position of the opening '(' parenthesis corresponding to the closing ')' parenthesis. More...
|
|
int | FindClose (uint32_t pos) const noexcept |
| Gets the position of the closing ')' parenthesis corresponding to the opening '(' parenthesis. More...
|
|
int | Enclose (uint32_t pos) const noexcept |
| Gets the position of the opening parenthesis that directly surround the specified parentheses. More...
|
|
int | FirstChild (uint32_t pos) const noexcept |
| Gets the position of the first opening parenthesis that is within the specified parentheses. More...
|
|
int | LastChild (uint32_t pos) const noexcept |
| Gets the position of the last closing parenthesis that is within the specified parentheses. More...
|
|
int | NextSibling (uint32_t pos) const noexcept |
| Gets the position of the parentheses corresponding to the next sibling node of the specified parentheses. More...
|
|
int | PrevSibling (uint32_t pos) const noexcept |
| Gets the position of the parentheses corresponding to the previous sibling node of the specified parentheses. More...
|
|
int | Parent (uint32_t pos) const noexcept |
| Returns the position of the parentheses equivalent to the parent node. More...
|
|
|
bool | Export (BinaryWriter *w) const noexcept |
| Writes the object to the file. More...
|
|
bool | Import (BinaryReader *r) noexcept |
| Reads the written object. More...
|
|
Provides a compact tree structure that can provide various operations in \(O(1)\)
constant time.
- Description
- The "parentheses representation of a tree" data structure is implemented using the methodology described at the following link.
- A parentheses representation of a tree is a method to describe an ordered tree (a tree with a node that has an ID). This tree is generated by outputting an opening parenthesis '(' when descending in a depth first search, and a closed parenthesis ')' when ascending. This enables you to represent a bit array as a tree.
- This class implements member functions that support various tree operations with
\(O(1)\)
constant time based on this data structure.
Definition at line 17 of file Bp.h.