{"id":50908136,"url":"https://github.com/dujeonglee/basiclibrary","last_synced_at":"2026-06-16T07:03:19.535Z","repository":{"id":196245900,"uuid":"46560331","full_name":"dujeonglee/basiclibrary","owner":"dujeonglee","description":"Basic data structure libraries for C++. It is simple to use but still powerful.","archived":false,"fork":false,"pushed_at":"2020-09-01T14:50:12.000Z","size":229,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-09-23T20:10:49.954Z","etag":null,"topics":["avl-tree","avltree","binary-search-tree","binary-tree","binary-trees","c-plus-plus","data-structures","header-only","headeronly","linked-data","linkedlist","thread-pool","threading","threadpool","tree-structure"],"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/dujeonglee.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}},"created_at":"2015-11-20T12:21:35.000Z","updated_at":"2023-09-23T20:15:22.187Z","dependencies_parsed_at":null,"dependency_job_id":"4a31818c-2e73-455f-b2f5-18bd826be3f4","html_url":"https://github.com/dujeonglee/basiclibrary","commit_stats":null,"previous_names":["dujeonglee/basiclibrary"],"tags_count":4,"template":null,"template_full_name":null,"purl":"pkg:github/dujeonglee/basiclibrary","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dujeonglee%2Fbasiclibrary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dujeonglee%2Fbasiclibrary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dujeonglee%2Fbasiclibrary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dujeonglee%2Fbasiclibrary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dujeonglee","download_url":"https://codeload.github.com/dujeonglee/basiclibrary/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dujeonglee%2Fbasiclibrary/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34393305,"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-06-16T02:00:06.860Z","response_time":126,"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":["avl-tree","avltree","binary-search-tree","binary-tree","binary-trees","c-plus-plus","data-structures","header-only","headeronly","linked-data","linkedlist","thread-pool","threading","threadpool","tree-structure"],"created_at":"2026-06-16T07:03:18.656Z","updated_at":"2026-06-16T07:03:19.530Z","avatar_url":"https://github.com/dujeonglee.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# basic data structures and libraries\nImplementation of basic data structures and libraries for own study.\n\n## Header only data structures\n  - AVL Tree: Insert, find, remove functions are provided.\n```\nAVLTree\u003cuint32_t/*Key Type*/, std::string/*Data Type*/\u003e map;\nmap[1] = std::string(\"Jake\");\nmap[2] = std::string(\"Tim\");\nstd::cout\u003c\u003cmap[1]\u003c\u003cstd::endl;\nmap[1] = std::string(\"Fake\");\nstd::cout\u003c\u003cmap[1]\u003c\u003cstd::endl;\n```\n## Libraries\n  - SingleShotTimer: C++11 based timer library. One can use this library to implement asynchronous software architecture.\n```\n#include \"SingleShotTimer.h\"\n#include \u003ciostream\u003e\n\n\nint main()\n{\n    std::cout\u003c\u003c\"--------------------------------------------------------------------\"\u003c\u003cstd::endl;\n    { \n        std::cout\u003c\u003c\"How to start and stop timer.\"\u003c\u003cstd::endl;\n        SingleShotTimer\u003c1/*Priority levels*/, 1/*Number of threads*/\u003e timer;// Timer is automatically started when instanciation.\n        timer.Stop();/*If one does not call \"Stop\", Dtor will call \"Stop\".*/\n    }\n    std::cout\u003c\u003c\"--------------------------------------------------------------------\"\u003c\u003cstd::endl;\n    {\n        std::cout\u003c\u003c\"How to schedule a task.\"\u003c\u003cstd::endl;\n        SingleShotTimer\u003c1, 1\u003e timer;\n        timer.ScheduleTaskNoExcept(1000, []()-\u003evoid{\n            std::cout\u003c\u003c\"Do something\"\u003c\u003cstd::endl;\n        });\n        std::this_thread::sleep_for(std::chrono::milliseconds(1500));\n    }\n    std::cout\u003c\u003c\"--------------------------------------------------------------------\"\u003c\u003cstd::endl;\n    {\n        std::cout\u003c\u003c\"How to cancel a task.\"\u003c\u003cstd::endl;\n        SingleShotTimer\u003c1, 1\u003e timer;\n        uint32_t task1 = timer.ScheduleTaskNoExcept(1000, []()-\u003evoid{\n            std::cout\u003c\u003c\"This task will not be served.\"\u003c\u003cstd::endl;\n        });\n        timer.ScheduleTaskNoExcept(1000, []()-\u003evoid{\n            std::cout\u003c\u003c\"Only this task is served.\"\u003c\u003cstd::endl;\n        });\n        timer.CancelTask(task1);\n        std::this_thread::sleep_for(std::chrono::milliseconds(1500));\n    }\n    std::cout\u003c\u003c\"--------------------------------------------------------------------\"\u003c\u003cstd::endl;\n    {\n        std::cout\u003c\u003c\"How to start periodic task.\"\u003c\u003cstd::endl;\n        SingleShotTimer\u003c1, 1\u003e timer;\n        uint32_t data = 0;\n        std::cout\u003c\u003c\"Periodic task ends when counting 49.\";\n        timer.PeriodicTask(10, [\u0026data]()-\u003ebool{\n            std::cout\u003c\u003c\"Count down \"\u003c\u003cdata++\u003c\u003c\"/49\"\u003c\u003cstd::endl;\n            if(data \u003c 50)\n            {\n                return true; /*Schedule the task after 10ms.*/\n            }\n            else\n            {\n                std::cout\u003c\u003c\"Periodic task is completed\"\u003c\u003cstd::endl;\n                return false; /*Stop the task.*/\n            }\n        });\n        std::this_thread::sleep_for(std::chrono::milliseconds(1000));\n    }\n    std::cout\u003c\u003c\"--------------------------------------------------------------------\"\u003c\u003cstd::endl;\n    return 0;\n}\n```\n  - ThreadPool: C++ based thread pool library.\n```\n#include \"ThreadPool.h\"\n#include \u003ciostream\u003e\n\nint main(int argc, char *argv[])\n{\n    std::cout\u003c\u003c\"--------------------------------------------------------------------\"\u003c\u003cstd::endl;\n    {\n        std::cout\u003c\u003c\"One thread\"\u003c\u003cstd::endl;\n        ThreadPool\u003c1/*Number of priority levels*/,1/*Number of threads*/\u003e threadpool;\n        for(unsigned int i = 0 ; i \u003c 10 ; i++)\n        {\n            threadpool.Enqueue([i](){\n                std::cout\u003c\u003c\"Task \"\u003c\u003ci\u003c\u003cstd::endl;\n                std::this_thread::sleep_for(std::chrono::milliseconds(1000));\n            });\n        }\n        while(threadpool.Tasks());\n    }\n    std::cout\u003c\u003c\"--------------------------------------------------------------------\"\u003c\u003cstd::endl;\n    {\n        std::cout\u003c\u003c\"Two threads\"\u003c\u003cstd::endl;\n        ThreadPool\u003c1/*Number of priority levels*/,2/*Number of threads*/\u003e threadpool;\n        for(unsigned int i = 0 ; i \u003c 10 ; i++)\n        {\n            threadpool.Enqueue([i](){\n                std::cout\u003c\u003c\"Task \"\u003c\u003ci\u003c\u003cstd::endl;\n                std::this_thread::sleep_for(std::chrono::milliseconds(1000));\n            });\n        }\n        while(threadpool.Tasks());\n    }\n    std::cout\u003c\u003c\"--------------------------------------------------------------------\"\u003c\u003cstd::endl;\n    {\n        std::cout\u003c\u003c\"Three threads\"\u003c\u003cstd::endl;\n        ThreadPool\u003c1/*Number of priority levels*/,3/*Number of threads*/\u003e threadpool;\n        for(unsigned int i = 0 ; i \u003c 10 ; i++)\n        {\n            threadpool.Enqueue([i](){\n                std::cout\u003c\u003c\"Task \"\u003c\u003ci\u003c\u003cstd::endl;\n                std::this_thread::sleep_for(std::chrono::milliseconds(1000));\n            });\n        }\n        while(threadpool.Tasks());\n    }\n    std::cout\u003c\u003c\"--------------------------------------------------------------------\"\u003c\u003cstd::endl;\n\treturn 0;\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdujeonglee%2Fbasiclibrary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdujeonglee%2Fbasiclibrary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdujeonglee%2Fbasiclibrary/lists"}