{"id":26875299,"url":"https://github.com/hxndev/implementing-grep-using-naive-search","last_synced_at":"2026-05-03T02:43:18.832Z","repository":{"id":107914092,"uuid":"375906621","full_name":"HxnDev/Implementing-GREP-using-Naive-Search","owner":"HxnDev","description":"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.","archived":false,"fork":false,"pushed_at":"2021-06-11T04:50:27.000Z","size":21,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T10:41:10.537Z","etag":null,"topics":["algorithm","command-line","cpp","grep","linux","naive-bayes-algorithm","search","time-complexity-analysis","utility"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HxnDev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-11T04:43:04.000Z","updated_at":"2022-06-18T06:22:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"e892dd57-cb38-4054-83cd-0cb3708ee2b0","html_url":"https://github.com/HxnDev/Implementing-GREP-using-Naive-Search","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/HxnDev/Implementing-GREP-using-Naive-Search","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HxnDev%2FImplementing-GREP-using-Naive-Search","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HxnDev%2FImplementing-GREP-using-Naive-Search/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HxnDev%2FImplementing-GREP-using-Naive-Search/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HxnDev%2FImplementing-GREP-using-Naive-Search/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HxnDev","download_url":"https://codeload.github.com/HxnDev/Implementing-GREP-using-Naive-Search/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HxnDev%2FImplementing-GREP-using-Naive-Search/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32556771,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T00:31:16.350Z","status":"online","status_checked_at":"2026-05-03T02:00:09.297Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm","command-line","cpp","grep","linux","naive-bayes-algorithm","search","time-complexity-analysis","utility"],"created_at":"2025-03-31T10:39:39.463Z","updated_at":"2026-05-03T02:43:18.827Z","avatar_url":"https://github.com/HxnDev.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Implementing-GREP-using-Naive-Search-\n\n# What is grep?\n```\nGrep is a command-line utility for searching plain-text data sets for lines that match a regular\nexpression or simply a string. E.g.\n```\n![alt text](https://github.com/HxnDev/Implementing-Linux-CL-Utility-GREP/blob/main/extra/grep_output.png?raw=true)\n\n## Part b:\n\n#### My Grep Algorithm = 248ms\n\n#### My Naïve Algorithm = 366ms\n\n## Reasoning:\n\n- My grep algorithm performed 32.2% better than the naïve algorithm.\n- My grep algorithm is more efficient and faster than naïve.\n- Naïve only takes one position movement at each time making it\n    inefficient.\n- In my grep algorithm, it does not match characters that we already\n    know will match.\n- When naïve finds a position, it does not use it to find another, instead\n    it goes back to the starting point and looks for pattern all over again.\n- The grep algorithm reuses the information from the previous shift\n    rather than disregarding it.\n    \n#### All the files have been commented for your ease. Furthermore you may also add further comments if you may.\n\n## For further queries contact me at : chhxnshah@gmail.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhxndev%2Fimplementing-grep-using-naive-search","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhxndev%2Fimplementing-grep-using-naive-search","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhxndev%2Fimplementing-grep-using-naive-search/lists"}