https://github.com/dujeonglee/basiclibrary
Basic data structure libraries for C++. It is simple to use but still powerful.
https://github.com/dujeonglee/basiclibrary
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
Last synced: 9 days ago
JSON representation
Basic data structure libraries for C++. It is simple to use but still powerful.
- Host: GitHub
- URL: https://github.com/dujeonglee/basiclibrary
- Owner: dujeonglee
- Created: 2015-11-20T12:21:35.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2020-09-01T14:50:12.000Z (almost 6 years ago)
- Last Synced: 2023-09-23T20:10:49.954Z (almost 3 years ago)
- 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
- Language: C++
- Homepage:
- Size: 224 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# basic data structures and libraries
Implementation of basic data structures and libraries for own study.
## Header only data structures
- AVL Tree: Insert, find, remove functions are provided.
```
AVLTree map;
map[1] = std::string("Jake");
map[2] = std::string("Tim");
std::cout<
int main()
{
std::cout<<"--------------------------------------------------------------------"< timer;// Timer is automatically started when instanciation.
timer.Stop();/*If one does not call "Stop", Dtor will call "Stop".*/
}
std::cout<<"--------------------------------------------------------------------"< timer;
timer.ScheduleTaskNoExcept(1000, []()->void{
std::cout<<"Do something"< timer;
uint32_t task1 = timer.ScheduleTaskNoExcept(1000, []()->void{
std::cout<<"This task will not be served."<void{
std::cout<<"Only this task is served."< timer;
uint32_t data = 0;
std::cout<<"Periodic task ends when counting 49.";
timer.PeriodicTask(10, [&data]()->bool{
std::cout<<"Count down "<
int main(int argc, char *argv[])
{
std::cout<<"--------------------------------------------------------------------"< threadpool;
for(unsigned int i = 0 ; i < 10 ; i++)
{
threadpool.Enqueue([i](){
std::cout<<"Task "< threadpool;
for(unsigned int i = 0 ; i < 10 ; i++)
{
threadpool.Enqueue([i](){
std::cout<<"Task "< threadpool;
for(unsigned int i = 0 ; i < 10 ; i++)
{
threadpool.Enqueue([i](){
std::cout<<"Task "<