Exemple #1
0
/**
 * Set the length of each leaf to e recursively
 * @param v the node in question
 */
static void set_e( node *v )
{
    if ( node_is_leaf(v) )
    {
        node_set_len( v, e-node_start(v)+1 );
    }
    node *u = node_children( v );
    while ( u != NULL )
    {
        set_e( u );
        u = node_next( u );
    }
}
Exemple #2
0
/**
 * Set the length of each leaf to e recursively
 * @param v the node in question
 * @param log the log to record errors in
 */
static void set_e( suffixtree *st, node *v, plugin_log *log )
{
    if ( node_is_leaf(v) )
    {
        node_set_len( v, st->e-node_start(v)+1 );
    }
    node_iterator *iter = node_children( v, log );
    if ( iter != NULL )
    {
        while ( node_iterator_has_next(iter) )
        {
            node *u = node_iterator_next( iter );
            set_e( st, u, log );
        }
        node_iterator_dispose( iter );
    }
}