diff options
Diffstat (limited to 'base/suffix_array.hpp')
-rw-r--r-- | base/suffix_array.hpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/base/suffix_array.hpp b/base/suffix_array.hpp new file mode 100644 index 0000000000..41cf35196a --- /dev/null +++ b/base/suffix_array.hpp @@ -0,0 +1,15 @@ +#pragma once + +#include <cstdint> +#include <string> +#include <vector> + +namespace base +{ +// Builds suffix array for the string |s| and stores result in the +// |sa| array. Size of |sa| must be not less than |n|. +// +// Time complexity: O(n) +void Skew(size_t n, uint8_t const * s, size_t * sa); +void Skew(std::string const & s, std::vector<size_t> & sa); +} // namespace base |