{"id":16582698,"url":"https://github.com/nodejh/searchingalgorithm","last_synced_at":"2026-04-20T07:33:31.017Z","repository":{"id":90786563,"uuid":"89797955","full_name":"nodejh/SearchingAlgorithm","owner":"nodejh","description":"SearchingAlgorithm","archived":false,"fork":false,"pushed_at":"2017-04-30T15:03:22.000Z","size":2,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-06T02:43:34.468Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"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/nodejh.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":"2017-04-29T16:30:27.000Z","updated_at":"2017-08-07T19:48:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"9c728ce6-444e-46fc-8a44-1d0123514ff0","html_url":"https://github.com/nodejh/SearchingAlgorithm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nodejh/SearchingAlgorithm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodejh%2FSearchingAlgorithm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodejh%2FSearchingAlgorithm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodejh%2FSearchingAlgorithm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodejh%2FSearchingAlgorithm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nodejh","download_url":"https://codeload.github.com/nodejh/SearchingAlgorithm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodejh%2FSearchingAlgorithm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32037866,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"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":[],"created_at":"2024-10-11T22:33:47.349Z","updated_at":"2026-04-20T07:33:30.984Z","avatar_url":"https://github.com/nodejh.png","language":"JavaScript","readme":"## 搜索算法\n\n在千万级数据的文件进行搜索到需要的数据 (Node.js)。\n\n参考至： [https://github.com/DeronLee/PracticeForProgrammingPearls/tree/master/SearchingAlgorithm/SpeechDoc](https://github.com/DeronLee/PracticeForProgrammingPearls/tree/master/SearchingAlgorithm/SpeechDoc) \n\n\n## 说明\n\n大体步骤：\n \n1. 对无序数据进行排序\n2. 对有序文件进行搜索，二分法\n\n\n文件：\n\n- `input_file_large.txt` 是原文件。\n- `sort_data.js` 中的程序实现了对大文件进行排序。\n\n\n## 运行\n\n排序：\n\n```\n$ node sort_data.js\n将大文件拆分为八个小文件: 25041.691ms\n排序0: 40624.006ms\n写文件0: 2334.398ms\n排序1: 39540.444ms\n写文件1: 2573.088ms\n排序2: 42552.704ms\n写文件2: 2394.856ms\n排序3: 38366.092ms\n写文件3: 2530.128ms\n排序4: 41338.223ms\n写文件4: 2391.502ms\n排序5: 36246.398ms\n写文件5: 2292.791ms\n排序6: 38040.837ms\n写文件6: 1901.534ms\n排序7: 36147.288ms\n写文件7: 1878.335ms\n将数据写入 result file: 331160.024ms\n```\n\n\n## TODO\n\n- [] 搜索\n- [] 数据量提升至亿级","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodejh%2Fsearchingalgorithm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnodejh%2Fsearchingalgorithm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodejh%2Fsearchingalgorithm/lists"}