template<class Char, std::unsigned_integral Size = std::size_t, class Compare = std::less<>>
class step20::suffix_array< Char, Size, Compare >
Manber's algorithm for constructing sorted array of non-empty suffixes.
Time complexity O(N*log(N)*log(N)), space complexity O(N), where: N - text length.
- Parameters
-
Char | - type of the characters; |
Size | - to specify the maximum number / offset of characters; |
Compare | - to determine the order of characters. |
template<class Char , std::unsigned_integral Size = std::size_t, class Compare = std::less<>>
std::span< const Size > step20::suffix_array< Char, Size, Compare >::find |
( |
std::ranges::input_range auto && |
str | ) |
const |
|
inline |
Find positions of suffixes starting with substring.
Time complexity O(M*log(N)), where: M - substring length, N - text length.