Analysis of Algorithms : An Active Learning Approach

(Ron) #1

140 MATCHING ALGORITHMS



  1. Program up the Boyer-Moore algorithm and count the number of character
    comparisons done for a few different cases. Don’t forget to count the com-
    parisons done in the calculation of the slide and jump arrays. Be sure to test
    both long and short patterns. Your program should output the location in
    the text (distance from the start) where the pattern was found and how
    many comparisons were done. How do your results compare to the analysis
    done in the text?

Free download pdf