Изменения
→Построение из суффиксного массива
<code>
 '''Node ''' addNextSuffix('''Node ''' previous, '''int''' length, '''int''' lcp):
    '''if''' (previous.depth == 0 '''or''' previous.depth == lcp)          <font color=green> // Добавляем к сыновьям текущей вершины </font>
       added = '''Node'''(previous, length)
       previous.children.push(added)
       '''return''' added
    '''else'''
       '''if''' previous.parent.depth < lcp:                         <font color=green> // Нужно разрезать ребро </font>
          inserted = '''Node'''(prevous.parent, lcp)
          previous.parent.children.pop()
          previous.parent.children.push(inserted)
       '''return''' addNextSuffix(previous.parent, length, lcp)      
 '''Node ''' buildSuffixTree('''int[]''' suf, '''int[]''' lcp, '''int''' length):    root = '''Node'''('''null''', 0)
    previous = root
    '''for''' i = 1 '''to''' length
<code>
 '''void''' calculatePositions('''Node ''' parent, '''Node ''' child, '''int''' stringLength):
    start = stringLength - child.maxDepth + parent.depth
    end = start + child.depth - parent.depth - 1
