lec31 - Suffix Trees String any sequence of characters...

This preview shows pages 1–7. Sign up to view the full content.

Suffix Trees String … any sequence of characters. Substring of string S … string composed of characters i through j , i <= j of S . S = cater => ate is a substring. car is not a substring. Empty string is a substring of S .

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Subsequence Subsequence of string S … string composed of characters i 1 < i 2 < … < i k of S . S = cater => ate is a subsequence. car is a subsequence. The empty string is a subsequence.
String/Pattern Matching You are given a source string S . Answer queries of the form: is the string p i a substring of S ? Knuth-Morris-Pratt (KMP) string matching. O(|S| + | p i |) time per query. O(n|S| + Σ i | p i |) time for n queries. Suffix tree solution. O(|S| + Σ i | p i |) time for n queries.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
String/Pattern Matching KMP preprocesses the query string p i , whereas the suffix tree method preprocesses the source string S . An application of string matching. Genome project. Databank of strings (gene sequences). Character set is ATGF . Determine if a “new” sequence is a substring of a databank sequence.
Definition Of Suffix Tree Compressed trie with edge information. Keys are the nonempty suffixes of a given string S . Nonempty suffixes of S = sleeper are: sleeper leeper eeper eper per , er , and r .

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
String Matching & Suffixes p i is
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern