Question: python def main(): # mini_test() assn = Assignment4 sizes = [100, 1000, 10000, 100000] algs = [native_search, brute_force, rabin_karp, knuth_morris_pratt, boyer_moore] trials = 10 for

python

python def main(): # mini_test() assn = "Assignment4" sizes = [100, 1000,

def main(): # mini_test() assn = "Assignment4" sizes = [100, 1000, 10000, 100000] algs = [native_search, brute_force, rabin_karp, knuth_morris_pratt, boyer_moore] trials = 10 for pattern_length in [4, 8, 12, 16]: title = "Runtime of String Search Algorithms" + str(pattern_length) dict_algs = run_algs(algs, sizes, trials) Assignment2.print_times(dict_algs) Assignment2.plot_times(dict_algs, sizes, trials, algs, title, assn + '.png')

[5] Create a loop to run the previous code several times for different length patterns (instead of hard-coded at 5): for pattern_length in [4,8,12,16] : * do run_algs for that pattern length * print the times for that pattern length * make the graph for pattern length You should submit one console output with runs for all pattern lengths, but only one graph for pattern length 4

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!