{"id":16109980,"url":"https://github.com/qqiangwu/pure-code","last_synced_at":"2025-04-06T05:24:53.804Z","repository":{"id":83081386,"uuid":"88465836","full_name":"qqiangwu/pure-code","owner":"qqiangwu","description":"Algorithms needing periodically reviewing","archived":false,"fork":false,"pushed_at":"2017-04-19T15:02:22.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-12T11:14:09.677Z","etag":null,"topics":["algorithms","algorithms-implemented"],"latest_commit_sha":null,"homepage":"","language":"C++","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/qqiangwu.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-17T03:51:23.000Z","updated_at":"2017-04-19T14:00:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"d3f05208-701e-4c50-9762-8d15b9f71330","html_url":"https://github.com/qqiangwu/pure-code","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qqiangwu%2Fpure-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qqiangwu%2Fpure-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qqiangwu%2Fpure-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qqiangwu%2Fpure-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qqiangwu","download_url":"https://codeload.github.com/qqiangwu/pure-code/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247439588,"owners_count":20939109,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","algorithms-implemented"],"created_at":"2024-10-09T19:35:04.990Z","updated_at":"2025-04-06T05:24:53.767Z","avatar_url":"https://github.com/qqiangwu.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# What's this?\nThis is a project aimed to be a text-book implementation of common data structures and algorithms. It provides both demo implementation and unit tests.\n\n# Principles\nThe code is intended to be **clean** and **simple**, and efficiency is not the principal goal. I will write the most efficient implementation in terms of computation complexity or provide implementation of different versions.\n\nCode example:\n\n```cpp\ntemplate \u003cclass Iter\u003e\nvoid linearInsert(Iter first, Iter last)\n{\n    auto insertionPoint = std::upper_bound(first, last, *last);\n\n    std::rotate(insertionPoint, last, last + 1);\n}\n\ntemplate \u003cclass Iter\u003e\nvoid insertionSort(Iter first, Iter last)\n{\n    // [begin, p) sorted\n    // [p, end) to be processed\n    for (auto p = first; p != last; ++p) {\n        linearInsert(first, p);\n    }\n}\n```\n\n# Usage\nIf you want to practice your coding skills, simply download the project and rewrite relevant algorithms and run unit tests yourself.\n\nWhen you are implementing an algorithm which requires other algorithms or data structures, you can simply use existing implementation in the standard library or in the repo and concentrate on the main ideas, for example:\n\n```c++\ntemplate \u003cclass Iter\u003e\nvoid quickSort(Iter first, Iter last)\n{\n    if (last - first \u003c= 1) {\n        return;\n    }\n\n    auto partitionPoint = partition(first, last);\n\n    quickSort(first, partitionPoint);\n    quickSort(partitionPoint, last);\n}\n```\n\nIn the above example, `partition` (implemented in the repo) is guaranteed to return two non-empty ranges if the length of the input range if larger than one such that we are assured that both the following recursion calls will occur on smaller dimensions.\n\n# Todo\nYou're welcomed to contribute to this project by either:\n\n+ Providing more typical unit tests or corner cases\n+ Reporting implementation bugs","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqqiangwu%2Fpure-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqqiangwu%2Fpure-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqqiangwu%2Fpure-code/lists"}