title: How to reverse a suffix tree of a string (findind the string it represents)
body: <p>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:
  <img src="https://i.stack.imgur.com/Fpk95.jpg" alt="enter image description here"></p>
  
  <p>this tree represents the string "banana" over the alphabet: {a, b, n}.</p>
  
  <p>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:</p>
  
  <p>The size of the alphabet is constant and that every string starts from index 1.</p>