helib::FullBinaryTree< T > Class Template 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
template<typename T>
class helib::FullBinaryTree< T >
A simple implementation of full binary trees (each non-leaf has 2 children)
Constructor & Destructor Documentation
◆ FullBinaryTree() [1/2]
template<typename T >
|
inline |
◆ FullBinaryTree() [2/2]
template<typename T >
|
inlineexplicit |
Member Function Documentation
◆ addChildren()
template<typename T >
long helib::FullBinaryTree< T >::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]
template<typename T >
|
inline |
◆ at() [2/2]
template<typename T >
|
inline |
◆ collapseToRoot()
template<typename T >
|
inline |
Remove all nodes in the tree except for the root.
◆ DataOfNode() [1/2]
template<typename T >
|
inline |
◆ DataOfNode() [2/2]
template<typename T >
|
inline |
◆ firstLeaf()
template<typename T >
|
inline |
◆ getAuxKey()
template<typename T >
|
inline |
◆ getNleaves()
template<typename T >
|
inline |
◆ lastLeaf()
template<typename T >
|
inline |
◆ leftChildIdx()
template<typename T >
|
inline |
◆ nextLeaf()
template<typename T >
|
inline |
◆ operator[]() [1/2]
template<typename T >
|
inline |
◆ operator[]() [2/2]
template<typename T >
|
inline |
◆ parentIdx()
template<typename T >
|
inline |
◆ prevLeaf()
template<typename T >
|
inline |
◆ printout()
template<typename T >
|
inline |
◆ putDataInRoot()
template<typename T >
|
inline |
◆ rightChildIdx()
template<typename T >
|
inline |
◆ rootIdx()
template<typename T >
|
inline |
◆ setAuxKey()
template<typename T >
|
inline |
◆ size()
template<typename T >
|
inline |