43 std::ostream& str=std::cout);
58 if (headNum != headCount) {
84 for (iChildren = t.
begin(iRoot), siblingNum = 0; iChildren != t.
end(iRoot); ++iChildren, ++siblingNum) {
88 if (siblingNum != siblingCount ) {
void print_tree_bracketed(const tree< T > &t, std::ostream &str=std::cout)
static unsigned int number_of_children(const iterator_base &)
Count the number of children of node at position.
Source code for th tree class.
bool empty() const
Check if tree is empty.
Iterator which traverses only the nodes which are siblings of each other.
pre_order_iterator end() const
Return iterator to the end of the tree.
pre_order_iterator begin() const
Return iterator to the beginning of the tree.
unsigned int number_of_siblings(const iterator_base &) const
Count the number of siblings (left and right) of node at iterator. Total nodes at this level is +1...
void print_subtree_bracketed(const tree< T > &t, typename tree< T >::iterator iRoot, std::ostream &str=std::cout)
Depth-first iterator, first accessing the node, then its children.