Skip to content

Latest commit

 

History

History
10 lines (7 loc) · 806 Bytes

File metadata and controls

10 lines (7 loc) · 806 Bytes

Explanation for Algorithm Comparison

Since the algorithms can run on different haystacks (texts) and needles (patterns), it is not fair to directly compare their run-time/comparison-count averages. Moreover, since the complexity of both of these algorithms involve two variables, n (text length) and m (pattern length), we need to study how the performance varies depending on the sizes of both n and m. Therefore, my program measures and outputs the following 4 ratios:

  1. Ratio between length of run-time and n.
  2. Ratio between length of run-time and m.
  3. Ratio between # of comparisons and n.
  4. Ratio between # of comparisons and m.

This is in an attempt to make a fair and accurate comparison between both algorithms. After each search, the averages for these 4 ratios are updated.