54 const std::string text =
"banana";
58 std::cout <<
"Suffix Array + LCP Example\n";
59 std::cout <<
"Text: " << text <<
"\n\n";
61 std::cout <<
"i sa[i] suffix lcp[i]\n";
62 for (
size_t i = 0; i < sa.size(); ++i)
64 std::cout << i <<
" " << sa[i] <<
" "
65 << text.substr(sa[i]) <<
" " <<
lcp[i] <<
'\n';
Suffix structures: suffix array/LCP, suffix tree, suffix automaton.
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.
Array< size_t > lcp_array_kasai(const std::string_view text, const Array< size_t > &sa)
Compute LCP array from text and suffix array using Kasai.
Array< size_t > suffix_array(const std::string_view text)
Build suffix array with doubling algorithm.
int main()
Example program that builds and prints the suffix array and Kasai LCP array for a sample string.