100 likes | 194 Views
McCrieght’s algorithm for linear-time suffix tree construction. Example. Example string: AAAAAAA. Conventions: T i corresponds to the tree after i iterations. Suffix numbering and string indexing starts from 1 and ends at n.
E N D
McCrieght’s algorithm for linear-time suffix tree construction Example
Example string: AAAAAAA • Conventions: • Ticorresponds to the tree after i iterations. • Suffix numbering and string indexing starts from 1 and ends at n. • Only for convenience in presentation, edge-labels are shown as strings. In the implementation, it is assumed that edge-labels are stored as a pair of integers. T1: Initial tree: Denotes suffix links T0: root
Example string: AAAAAAA Iteration: 1 T1: T0: root root A A A A A A A $ For this iteration: 1
Example string: AAAAAAA Iteration: 2 T1: T2: root root A A A Case IB A A A A A A A A A A A $ $ $ For this iteration: 2 1 1
Example string: AAAAAAA Iteration: 3 T2: T3: root root A A A Case IIB A A A A A A A A A $ A $ A $ $ 3 $ For this iteration: 2 2 1 1 =AAAAAA = A ’
Example string: AAAAAAA Iteration: 4 T3: T4: root root A A A Case IIB A A A A A A A $ A $ A $ 4 A $ A $ 3 $ 3 $ For this iteration: 2 2 1 1 =AAAAA = A ’
Example string: AAAAAAA Iteration: 5 T4: T5: root root A A A Case IIB A A A A A $ A $ A $ 5 A $ A 4 $ 4 A $ A $ 3 $ 3 $ For this iteration: 2 2 1 1 =AAAA = A ’
Example string: AAAAAAA Iteration: 6 T5: T6: root root A A A Case IIB A A A A $ $ A $ A $ A 6 5 $ 5 A $ A 4 $ 4 A $ A $ 3 $ 3 $ For this iteration: 2 2 1 1 =AAA = A ’
Example string: AAAAAAA Iteration: 7 T6: T7: root root A A A Case IIB A $ A $ A A $ $ A $ 7 A 6 $ A 6 5 $ 5 A $ A 4 $ 4 A $ A $ 3 $ 3 $ For this iteration: 2 2 1 1 =AA = A ’
Example string: AAAAAAA Iteration: 8 T7: T8: root root A $ A A Case IIB $ A $ A $ 8 A A $ $ 7 A $ 7 A 6 $ A 6 5 $ 5 A $ A 4 $ 4 A $ A $ 3 $ 3 $ For this iteration: 2 2 1 1 =A = A ’