Given a (modified/broken) suffix tree, which stores in each edge the beginning and ending of the current substring, but not the substring itself, i.e a suffix tree that looks like this:
this tree represents the string "banana" over the alphabet: {a, b, n}.
The algorithm I'm looking for is to find the string that a tree of that sort represents, for the example above, I would like the algorithm to find "banana". I would like to that in a complexity of O(|string|) where |string| is the length of the string that is being searched. It can be assumed that:
The size of the alphabet is constant and that every string starts from index 1.