helib::FullBinaryTree Class Reference
A simple implementation of full binary trees (each non-leaf has 2 children) More...
#include <permutations.h>
Public Member Functions | |
FullBinaryTree (long _aux=0) | |
FullBinaryTree (const T &d, long _aux=0) | |
void | putDataInRoot (const T &d) |
long | size () |
TreeNode< T > & | operator[] (long i) |
const TreeNode< T > & | operator[] (long i) const |
TreeNode< T > & | at (long i) |
const TreeNode< T > & | at (long i) const |
T & | DataOfNode (long i) |
const T & | DataOfNode (long i) const |
long | getAuxKey () const |
void | setAuxKey (long _aux) |
long | getNleaves () const |
long | firstLeaf () const |
long | nextLeaf (long i) const |
long | prevLeaf (long i) const |
long | lastLeaf () const |
long | rootIdx () const |
long | parentIdx (long i) const |
long | leftChildIdx (long i) const |
long | rightChildIdx (long i) const |
void | printout (std::ostream &s, long idx=0) const |
long | addChildren (long prntIdx, const T &leftData, const T &rightData) |
void | collapseToRoot () |
Remove all nodes in the tree except for the root. More... | |
Detailed Description
A simple implementation of full binary trees (each non-leaf has 2 children)
Constructor & Destructor Documentation
◆ FullBinaryTree() [1/2]
|
inline |
◆ FullBinaryTree() [2/2]
|
inlineexplicit |
Member Function Documentation
◆ addChildren()
long helib::FullBinaryTree::addChildren | ( | long | prntIdx, |
const T & | leftData, | ||
const T & | rightData | ||
) |
If the parent is a leaf, add to it to children with the given data, else just update the data of the two children of this parent. Returns the index of the left child, the right-child index is one more than the left-child index.
◆ at() [1/2]
|
inline |
◆ at() [2/2]
|
inline |
◆ collapseToRoot()
|
inline |
Remove all nodes in the tree except for the root.
◆ DataOfNode() [1/2]
|
inline |
◆ DataOfNode() [2/2]
|
inline |
◆ firstLeaf()
|
inline |
◆ getAuxKey()
|
inline |
◆ getNleaves()
|
inline |
◆ lastLeaf()
|
inline |
◆ leftChildIdx()
|
inline |
◆ nextLeaf()
|
inline |
◆ operator[]() [1/2]
|
inline |
◆ operator[]() [2/2]
|
inline |
◆ parentIdx()
|
inline |
◆ prevLeaf()
|
inline |
◆ printout()
|
inline |
◆ putDataInRoot()
|
inline |
◆ rightChildIdx()
|
inline |
◆ rootIdx()
|
inline |
◆ setAuxKey()
|
inline |
◆ size()
|
inline |