ass06-b

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

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

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 ﬁnding the palindroms of a string. 2. Given a suﬃx tree in which the edge labels are all missing, give an algorithm
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 suﬃx tree to the node. • Show that for every node v of a suﬃx tree, if s ( v ) = aB , a ∈ Σ ,B ∈ Σ * , there is a node u such that s ( u ) = B . Note that this relationship deﬁnes a function sl ( v ) = u , which is called the suﬃx link of v . • Give an algorithm for computing sl () for every node. Note that there is a linear time algorithm that ﬁnds all suﬃx links for any alphabet....
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online