Skip to content

SaifTaherDev/RabinBoyer-CPP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

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.

About

Performance analysis of the Rabin-Karp algorithm and the Boyer-moore algorithms in C++

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages