icpc2018/4/E.cpp
void buildSuffixTree() {
    size = strlen(text);
    int i;
    rootEnd = (int *)malloc(sizeof(int));
    *rootEnd = -1;

    /*Root is a special node with start and end indices as -1,
    as it has no parent from where an edge comes to root*/
    root = newNode(-1, rootEnd);

    activeNode = root;  // First activeNode will be root
    for (i = 0; i < size; i++) extendSuffixTree(i);
    int labelHeight = 0;
    setSuffixIndexByDFS(root, labelHeight);
}
/*Build the suffix tree and print the edge labels along with
suffixIndex. suffixIndex for leaf edges will be >= 0 and
for non-leaf edges will be -1*/
Build the suffix tree and print the edge labels along with
suffixIndex. suffixIndex for leaf edges will be >= 0 and
for non-leaf edges will be -1
Build the suffix tree and print the edge labels along with suffixIndex . suffixIndex for leaf edges will be > = 0 and for non - leaf edges will be - 1
void buildSuffixTree() {
    size = strlen(text);
    int i;
    rootEnd = (int *)malloc(sizeof(int));
    *rootEnd = -1;
    root = newNode(-1, rootEnd);
    activeNode = root;  
    for (i = 0; i < size; i++) extendSuffixTree(i);
    int labelHeight = 0;
    setSuffixIndexByDFS(root, labelHeight);
}
void buildSuffixTree ( ) { size = strlen ( text ) ; int i ; rootEnd = ( int * ) malloc ( sizeof ( int ) ) ; * rootEnd = -1 ; root = newNode ( -1 , rootEnd ) ; activeNode = root ; for ( i = 0 ; i < size ; i ++ ) extendSuffixTree ( i ) ; int labelHeight = 0 ; setSuffixIndexByDFS ( root , labelHeight ) ; }
Build the suffix tree and print the edge labels along with
suffixIndex.
Build the suffix tree and print the edge labels along with suffixIndex .
/*Root is a special node with start and end indices as -1,
    as it has no parent from where an edge comes to root*/ // First activeNode will be root