ttg::BinarySpanningTree Class Reference

Documentation

a binary spanning tree of integers in the [0,size) interval

This is a binary spanning tree of the complete graph of the [0,size) set of keys, rooted at a particular key.

Definition at line 17 of file tree.h.

Public Member Functions

 BinarySpanningTree (int size, int root)
 
 ~BinarySpanningTree ()=default
 
const auto size () const
 
const auto root () const
 
int parent_key (const int child_key) const
 
std::pair< int, int > child_keys (const int parent_key) const
 

Constructor & Destructor Documentation

◆ BinarySpanningTree()

ttg::BinarySpanningTree::BinarySpanningTree ( int  size,
int  root 
)
inline

Definition at line 19 of file tree.h.

◆ ~BinarySpanningTree()

ttg::BinarySpanningTree::~BinarySpanningTree ( )
default

Member Function Documentation

◆ child_keys()

std::pair<int, int> ttg::BinarySpanningTree::child_keys ( const int  parent_key) const
inline
Parameters
[in]parent_keythe key of the parent
Returns
the pair of child keys (-1 if there is no child)

Definition at line 40 of file tree.h.

◆ parent_key()

int ttg::BinarySpanningTree::parent_key ( const int  child_key) const
inline
Parameters
[in]child_keythe key of the child
Returns
the parent key (-1 if there is no parent)

Definition at line 32 of file tree.h.

◆ root()

const auto ttg::BinarySpanningTree::root ( ) const
inline
Returns
the root of the tree

Definition at line 28 of file tree.h.

◆ size()

const auto ttg::BinarySpanningTree::size ( ) const
inline
Returns
the size of the tree

Definition at line 26 of file tree.h.


The documentation for this class was generated from the following file: