How can I do the next operation, with a suffix tree of string s, who's number of vertices is bounded by O(|s|):
Is-k-Sub-string(r) - checks if string r is a k-sub-string of s, where a k-sub-string defined as follow:
A sub-string r of s defined as k-sub-string if there is a partition of s to sub-strings for which:
r=x1x2...xk; xi = sub-string of s.
Example: s = whitething, r = within, r is 3-sub-string of s.
I need that operation to work in complexity of O(|r|).
I don't understand how to do that on O(|r|), because each character in r can be the current delimiter, for example with 2-Sub-string, so for that I must to try all the possible characters as delimiters between x1 and x2 (for the partition r=x1x2).
Any ideas ?