Unformatted text preview: by procedure find1 (i.e. the straightforward algorithm)? How many character comparisons are required by procedure find2 (i.e. the KMP algorithm)? Using find 1 a b b b a b b a a b b a b a a b a b a a b a a b a a b a b b a b b b a b b a # pass1 a b a 3 pass2 a 1 pass3 a 1 pass4 a 1 pass5 a b a 3 pass6 a 1 pass7 a 1 pass8 a b 2 pass9 a b a 3 pass10 a 1 pass11 a 1 pass12 a b a a b a a 7 pass13 a 1 pass14 a b 2 pass15 a b a a 4 pass16 a 1 pass17 a b a a b a a b a b 10 pass18 a 1 pass19 a b 2 pass20 a b a a b a a b a b 10 56...
View
Full Document
 Spring '03
 janicki
 1997 in film, Knuth–Morris–Pratt algorithm, CS2MD3. Sample solutions, character comparisons, pass14 ab pass15

Click to edit the document details