https://github.com/hxndev/implementing-grep-using-naive-search
GREP is a command-line utility for searching plain-text data sets for lines that match a regular expression or simply a string. In this, I implemented GREP using Naive Search.
https://github.com/hxndev/implementing-grep-using-naive-search
algorithm command-line cpp grep linux naive-bayes-algorithm search time-complexity-analysis utility
Last synced: 10 days ago
JSON representation
GREP is a command-line utility for searching plain-text data sets for lines that match a regular expression or simply a string. In this, I implemented GREP using Naive Search.
- Host: GitHub
- URL: https://github.com/hxndev/implementing-grep-using-naive-search
- Owner: HxnDev
- License: mit
- Created: 2021-06-11T04:43:04.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-11T04:50:27.000Z (almost 5 years ago)
- Last Synced: 2025-03-31T10:41:10.537Z (about 1 year ago)
- Topics: algorithm, command-line, cpp, grep, linux, naive-bayes-algorithm, search, time-complexity-analysis, utility
- Language: C++
- Homepage:
- Size: 20.5 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Implementing-GREP-using-Naive-Search-
# What is grep?
```
Grep is a command-line utility for searching plain-text data sets for lines that match a regular
expression or simply a string. E.g.
```

## Part b:
#### My Grep Algorithm = 248ms
#### My Naïve Algorithm = 366ms
## Reasoning:
- My grep algorithm performed 32.2% better than the naïve algorithm.
- My grep algorithm is more efficient and faster than naïve.
- Naïve only takes one position movement at each time making it
inefficient.
- In my grep algorithm, it does not match characters that we already
know will match.
- When naïve finds a position, it does not use it to find another, instead
it goes back to the starting point and looks for pattern all over again.
- The grep algorithm reuses the information from the previous shift
rather than disregarding it.
#### All the files have been commented for your ease. Furthermore you may also add further comments if you may.
## For further queries contact me at : chhxnshah@gmail.com