Top-Down Iteration - SeqAn API Documentation

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

## Grouped Tags Overview

- `ParentLinks`
  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.

## 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;
    }

Demo: demos/dox/index/begin_atEnd_representative.cpp

    A
    AA
    ATAA
    TA
    TAA
    TATAA
    --------------------------------
    AA
    ATAA
    A
    TAA
    TATAA
    TA

## Grouped Tags Detail

### `ParentLinks`

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.

#### Dox Sources

    /*!
     * @defgroup TopDown Top-Down Iteration
     *
     * @brief Tag that specifies a @link VSTreeIterator @endlink to traverse the
     *        virtual string tree from the root towards the leafs.
     *
     * @section Examples
     *
     * The following example shows how a the @link TopDown @endlink tag is used.
     *
     * @include demos/dox/index/begin_atEnd_representative.cpp
     *
     * @code{.output}
     * A
     * AA
     * ATAA
     * TA
     * TAA
     * TATAA
     * --------------------------------
     * AA
     * ATAA
     * A
     * TAA
     * TATAA
     * TA
     * @endcode
     *
     *
     * @tag TopDown#ParentLinks
     *
     * @brief A top down iterator with the possibility to go back up again.
     *
     * @tag TopDown#Preorder
     *
     * @brief Pre-order traversal of the virtual string tree.
     *
     * @tag TopDown#Postorder
     *
     * @brief Post-order traversal of the virtual string tree.
     */