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
 Spring '10
 Prizler
 Algorithms, Complex number

Click to edit the document details