36 void print_tree_bracketed(
const tree<T>& t, std::ostream& str=std::cout);
40 std::ostream& str=std::cout);
48 void print_tree_bracketed(
const tree<T>& t, std::ostream& str)
53 print_subtree_bracketed(t,iRoots,str);
54 if (headNum != headCount) {
78 for (iChildren = t.
begin(iRoot), siblingNum = 0; iChildren != t.
end(iRoot); ++iChildren, ++siblingNum) {
80 print_subtree_bracketed(t,iChildren,str);
82 if (siblingNum != siblingCount ) {
static unsigned int number_of_children(const iterator_base &)
Count the number of children of node at position.
Definition: tree.h:1697
bool empty() const
Check if tree is empty.
Definition: tree.h:1625
Iterator which traverses only the nodes which are siblings of each other.
Definition: tree.h:207
pre_order_iterator end() const
Return iterator to the end of the tree.
Definition: tree.h:619
pre_order_iterator begin() const
Return iterator to the beginning of the tree.
Definition: tree.h:613
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...
Definition: tree.h:1713
Depth-first iterator, first accessing the node, then its children.
Definition: tree.h:126