







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Suffix trees and their application in string matching. Suffix trees are a data structure used to efficiently determine if a given pattern is a substring of a larger string. Various types of suffix trees, including suffix arrays and enhanced suffix arrays, and their use in substring matching. It also mentions the knuth-morris-pratt algorithm as an alternative string matching method and its comparison to suffix trees. Examples of suffix trees for different strings and explains how to construct them.
Typology: Slides
1 / 13
This page cannot be seen from the preview
Don't miss anything!








S = cater => ate is a substring.
car is not a substring.
Empty string is a substring of S.
1
2
k
S = cater => ate is a subsequence.
car is a subsequence.
The empty string is a subsequence.
O(|S| + | p i
|) time per query.
O(n|S| + Σ i
| p i
|) time for n queries.
i
| p i
|) time for n queries.
i
sleeper
leeper
eeper
eper
per, er, and r.
leep, eepe, pe, leap, peel
creeper, reeper, eeper, eper, per, er, r
creeper#, reeper#, eeper#, eper#, per#, er#, r#, #
abbb
b
abbbb# b#
abbbb# #
b
abbbb#
abbbb#
b
b#
abbb
b
abbbb# b#
abbbb# #
b
abbbb#
abbbb#
b
b#
lexicographic order.
Assume # < a < b
# < abbbabbbb# < abbbb# < b# < babbbb# <
bb# < bbabbbb# < bbb# < bbbabbbb# < bbbb#
LCP = length of longest common prefix
between adjacent entries of SA.
solved by a suffix tree with same asymptotic
complexity.
Substring matching binary search for p using SA.
O(|p| log |S|).
babb abbba baba
abbb
b
abbbb# b#
abbbb# #
b
abbbb#
abbbb#
b
b#
abbb
b
abbbb# b#
abbbb# #
b
abbbb#
abbbb#
b
b#
i
i
Link all element nodes into a chain in inorder.
Each branch node keeps a pointer to the left most
and right most element node in its subtree.
abbb
b
abbbb# b#
abbbb# #
b
abbbb#
abbbb#
b
b#
U = carport$airports#
No repeating substring includes $.
Find longest repeating substring that is both to left and
right of $.