Group Top-Down Iteration
Tag that specifies a VSTreeIterator to traverse the virtual string tree from the root towards the leafs.

Grouped Tags Overview

Detailed Description

Examples

The following example shows how a the TopDown tag is used.

#include <seqan/index.h>

using namespace seqan;

int main()
{
    typedef Index<CharString> TIndex;
    TIndex index("TATAA");

    Iterator<TIndex, TopDown<ParentLinks<> > >::Type itDefault;
    itDefault = begin(index, TopDown<ParentLinks<> >());

    while (!atEnd(itDefault))
    {
        std::cout << representative(itDefault) << std::endl;
        goNext(itDefault);
    }

    std::cout << "--------------------------------" << std::endl;

    Iterator<TIndex, TopDown<ParentLinks<Postorder> > >::Type itPostOrder;
    itPostOrder = begin(index, TopDown<ParentLinks<Postorder> >());

    while (!atEnd(itPostOrder))
    {
        std::cout << representative(itPostOrder) << std::endl;
        goNext(itPostOrder);
    }

    return 0;
}
A
AA
ATAA
TA
TAA
TATAA
--------------------------------
AA
ATAA
A
TAA
TATAA
TA

Grouped Tags Detail

A top down iterator with the possibility to go back up again.

Postorder

Post-order traversal of the virtual string tree.

Preorder

Pre-order traversal of the virtual string tree.