Suffix Tree Revision Flashcards
Suffix Tree resembles to
Search Tries or Tries
Trie
The tree-like data structure which have nodes and edges corresponding to a particular character.
Suffix Tree
Also tree like DS which have edge labels as the intervals and not the characters only. Each edge label have arbitrary length string carrying over it.
Algorithm proceeds with
Phases or steps which constitute extension among them.
Number of phases
O(n) ; n: length of the string. For each character, we have a phase to go through and for each of the phases, we have the extensions corresponding to it.
Number of extensions or the individual steps in the phase
The upper bound is O(n) which is the worst case in which we have to go through the steps of O(n) times for completing a single phase.
Edge carries
Intervals : [start, end] which shows how much string length we are talking about with a single edge.
Start of the string will say about the starting index of the suffix of the present phase and ending index for the ending index of the present phase.
The space complexity of the edge
For each edge two variables have to be maintained and not the overall string at once. Therefore two variable will constitute to O(1) complexity for each of the edge.
What about end index ?
Usually for the better implementation we tend to label th end index by some common variable like end for all the leaves due to which it gets automatically consistent with the suffixes of the next phase as well.
ex. [1, #]
Tree is correct suffix tree upto in each step
Current character ofcourse
Steps in the algorithm
n : length of the string (number of characters)
Work at each step
O(1) where n is the length of the string; other than this the updating process of the suffix tree can be accomplished by using the end index updating at the same time.
First Extensions
Simple Repetition
Active Point
Three tuples: (active_point, active_node, active_length)
Remainder
An integer indicating how many new suffices we need to insert.