{"id":20639253,"url":"https://github.com/alexdremov/1cqualification","last_synced_at":"2026-07-13T00:32:14.713Z","repository":{"id":146181911,"uuid":"476186111","full_name":"alexdremov/1CQualification","owner":"alexdremov","description":"Практическое задание для отбора на кафедру КИС","archived":false,"fork":false,"pushed_at":"2022-03-31T17:55:49.000Z","size":608,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-27T18:43:52.604Z","etag":null,"topics":["algorithms","bigdata","cpp","knuth-morris-pratt","strings","suffix-tree","ukkonen"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexdremov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-03-31T06:53:00.000Z","updated_at":"2022-04-04T08:28:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"fa09d373-9e20-4cce-9a66-16f086846a10","html_url":"https://github.com/alexdremov/1CQualification","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alexdremov/1CQualification","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexdremov%2F1CQualification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexdremov%2F1CQualification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexdremov%2F1CQualification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexdremov%2F1CQualification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexdremov","download_url":"https://codeload.github.com/alexdremov/1CQualification/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexdremov%2F1CQualification/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35406584,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-12T02:00:06.386Z","response_time":87,"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":["algorithms","bigdata","cpp","knuth-morris-pratt","strings","suffix-tree","ukkonen"],"created_at":"2024-11-16T15:23:08.555Z","updated_at":"2026-07-13T00:32:14.693Z","avatar_url":"https://github.com/alexdremov.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 1CQualification — String search\n\nВ решении используется сразу несколько алгоритмов и рассматривается возможность,\nчто файл может не поместиться в оперативную память.\n\n## Установка\n\n```bash\nmkdir build\ncd build\ncmake .. -DCMAKE_BUILD_TYPE=Release\nmake\n```\n\n\n## Использование\n```\nSearch substring in a file, enter pattern in stdin. Type !exit to exit\nUsage:\n  StringMatch [OPTION...]\n\n  -f, --file arg      File name\n  -s, --single        Get first entry only\n  -x, --extralarge    Extra large file search. O(nm) solution but can work \n                      with extra large data\n  -b, --buffSize arg  Buffer size for extra large mode in bytes. 100Mb by default \n  -v, --verbose       Verbose (default: true)\n  -h, --help          Print usage\n```\n\n## Алгоритм\n\nВ случае большого файла, он разбивается на пересекающиеся куски и каждый кусок обрабатывается как указано ниже.\n\nДля `pattern` размеров 1, 2, 4, 8 используется оптимизация маленьких строк: `pattern` хранится в `uint{16, 32, 64}_t`. Для однобайтовых `pattern` используется `strchr`.\n\nВ остальных случаях применяется два алгоритма:\n\n- Только первое вхождение\nВ этом случае используется сжатый бор. Построение алгоритмом Укконена.\n  - Асимптотика построения: O(|text|)\n  - Асимптотика ответа: O(|pattern|)\n- Все вхождения\nИспользуется алгоритм Кнута-Морриса-Пратта\n  - Асимптотика построения: O(1)\n  - Асимптотика ответа: O(|text|)\n\n## Тестирование\n\n```bash\nmkdir testbuild\ncd testbuild\ncmake ..\nmake\nctest\n```\n\n## Doxygen документация\n\u003ca href=\"https://alexroar.github.io/1CQualification/annotated.html\"\u003elink\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexdremov%2F1cqualification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexdremov%2F1cqualification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexdremov%2F1cqualification/lists"}