Skip to content

πŸ”Ž Comparison of string pattern searching algorithms.

Notifications You must be signed in to change notification settings

Edurz135/StringSearchingAlgorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

String Searching Algorithms

In order to compare the efficiency of two string search algorithms, the objective is to measure the time it takes to search for a specific word in a text using both the Z algorithm and the Anagram algorithm.

Installation

Just clone the repository and execute every cell in start.ipynb. Not forget to install all the dependencies.

Results

For a more consistent comparison, four datasets of different sizes (specifically 8.40, 16.80, 25.19, and 33.59 MB) will be used. From each dataset, five random words will be extracted, and these will be used to measure the execution time of each algorithm.

The data used in this comparison were extrated from https://www.kaggle.com/datasets/sunnysai12345/news-summary.

Z algorithm

Execution time (in seconds) for Z Algorithm per each word and dataset.

Anagram Search

Execution time (in seconds) for Anagram Search per each word and dataset.

Comparison

Average execution time (in seconds) per algorithm and dataset.

In conclusion, both algorithm have done a good job, but `Z algorithm` proves to be better than `Anagram Search` in terms of efficiently.

About

πŸ”Ž Comparison of string pattern searching algorithms.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published