Beispiel #1
0
int main() {
    string s1, s2, s3;
    SuffixTree<'#'> tree;
    cin >> s1 >> s2 >> s3;
    tree.add_string(s1);
    tree.add_string(s2);
    tree.add_string(s3);
    tree.build_suffix_tree();
    tree.solve();
    /*
    {
        SuffixTree<'#'> tree;
        tree.add_string("baab");
        tree.build_suffix_tree();
        tree.print_preorder();
        tree.print_suffix_array();
    }

    {
        SuffixTree<'#'> tree;
        tree.add_string("banana");
        tree.add_string("xana");
        tree.build_suffix_tree();
        tree.find_max_common_substring();
    }
    */
    return 0;
}
Beispiel #2
0
int main()
{
    SuffixTree<std::string> tree;
    tree.add_string("mississippi$");
    tree.add_string("missouri$");
    tree.dump_tree();
    return 0;
}