Function
countChildren
Count the number of children of a tree node.
Include Headers
seqan/index.h
Parameters
An iterator of a suffix tree. Types: VSTree Iterator |
Return Values
The number of children of a tree node.
If iterator 's container type is TIndex , the return type is Size<TIndex>::Type .
Member of
Examples
typedef Index< String<char> > TMyIndex;
TMyIndex myIndex(myString);
Iterator< TMyIndex, TopDown<ParentLinks<PreorderEmptyEdges> > >::Type tdIterator(myIndex);
Size<TMyIndex>::Type count;
while (!atEnd(tdIterator)) {
// We print out the representatives of all nodes that have more than 3 children and the number of occurrences.
count = countChildren(tdIterator);
if (count >= 3)
{
::std::cout << "Representative " << representative(tdIterator) << " has " << count << " children and " << countOccurrences(tdIterator) << " Occurrences " << ::std::endl;
++tdIterator;
}
Example Programs
SeqAn - Sequence Analysis Library - www.seqan.de