54 const std::string text =
"banana";
57 std::cout <<
"Naive Suffix Tree Example\n";
58 std::cout <<
"Text: " << text <<
"\n";
59 std::cout <<
"Node count: " << st.
node_count() <<
"\n\n";
61 const std::string pattern =
"ana";
64 std::cout <<
"Pattern: " << pattern <<
"\n";
65 std::cout <<
"Contains: " << (
not matches.is_empty() ?
"yes" :
"no") <<
"\n";
66 std::cout <<
"Matches at positions: ";
67 for (
size_t i = 0; i <
matches.size(); ++i)
Suffix structures: suffix array/LCP, suffix tree, suffix automaton.
Naive compressed suffix tree (didactic implementation).
Array< size_t > find_all(const std::string_view pattern) const
Return all occurrences of a pattern.
size_t node_count() const noexcept
Return the number of nodes in the tree.
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
Main namespace for Aleph-w library functions.
int main()
Example program demonstrating construction and queries on a Naive_Suffix_Tree for the string "banana"...