This preview shows page 1. Sign up to view the full content.
Unformatted text preview: the text string may be read and compared to a pattern character. Show your bound to be tight. 4. Describe a linear time algorithm that decides whether a given string S is a cyclic shift of a given string T (for example ’liccyc’ is a cyclic shift of ’cyclic’ ). 5. (Relatively hard) Let y i denote the concatenation of a string y with itself i times. ²or example ( ab ) 3 = ababab . We say that a string x has a repetition factor r if x = y r for some string y and r > 0. let ρ ( x ) denote the largest r such that x has repetition factor r . Give an e±cient algorithm that takes as input a pattern P [1 ...n ] and computes for all its preFxes P i the value ρ ( P i ) ( P i = P [1 ...i ]). What is the running time of your algorithm? 1...
View Full Document
This note was uploaded on 03/08/2010 for the course ENGINEERIN 50-22-43-2 taught by Professor Prizler during the Spring '10 term at Tel Aviv Uni..
- Spring '10