ass06-b - for adding the labels back The leaves are labeled...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Fall 2011 CS 513: #6 Farach-Colton Due by the beginning of class, Nov. 8. 1. A palindrom is a string that reads the same forwards and backwards, like “Able was I ere I saw Elba” or “Lonenly Tylenol” (in this case if you ignore the spaces). Given a string, a palindrom of the string is a maximal substring that’s a palin- drom, so that “bbaaabbbaaaaa” has aplindrom “bbaa” and “bb” and “aaabb- baaa” and “aaaaa”, etc. Prove that any string has an at most linear number of palindroms. Give an algorithm for finding the palindroms of a string. 2. Given a suffix tree in which the edge labels are all missing, give an algorithm
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: for adding the labels back. The leaves are labeled. There is an algorithm that runs in linear time for any alphabet. 3. Let s ( v ) be the string of a node v , which is the concatenation of all the strings from the root of a suffix tree to the node. • Show that for every node v of a suffix tree, if s ( v ) = aB , a ∈ Σ ,B ∈ Σ * , there is a node u such that s ( u ) = B . Note that this relationship defines a function sl ( v ) = u , which is called the suffix link of v . • Give an algorithm for computing sl () for every node. Note that there is a linear time algorithm that finds all suffix links for any alphabet....
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online