# include <iostream>
# include <string>
# include <format>
template <typename Range>
{
std::cout << label << ": ";
for (
const auto & item :
r)
std::cout << std::format("{} ", item);
std::cout << "\n";
}
{
const std::string text = "aabcaabxaaaz";
const std::string pattern = "aab";
const auto z = z_algorithm(text);
const auto matches = z_search(text, pattern);
std::cout << std::format("Z-Algorithm Example\nText : {}\nPattern: {}\n\n",
text, pattern);
return 0;
}
Classical pattern searching algorithms over strings.
Main namespace for Aleph-w library functions.
void print_range(std::string_view label, const Range &r)
Print a label followed by the elements of a range to standard output.