{"id":25419428,"url":"https://github.com/tyhil/general-tree","last_synced_at":"2025-10-19T15:53:26.144Z","repository":{"id":158382479,"uuid":"369071824","full_name":"TyHil/general-tree","owner":"TyHil","description":"A general tree C++ library","archived":false,"fork":false,"pushed_at":"2021-09-24T00:15:47.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-16T18:40:06.851Z","etag":null,"topics":["cpp","general-tree","pointers","tree"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TyHil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-05-20T03:49:23.000Z","updated_at":"2021-12-04T19:00:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"c7254b7b-820d-46d7-ab4f-81f0e27c93f2","html_url":"https://github.com/TyHil/general-tree","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/TyHil%2Fgeneral-tree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TyHil%2Fgeneral-tree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TyHil%2Fgeneral-tree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TyHil%2Fgeneral-tree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TyHil","download_url":"https://codeload.github.com/TyHil/general-tree/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253166474,"owners_count":21864469,"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":["cpp","general-tree","pointers","tree"],"created_at":"2025-02-16T18:39:37.113Z","updated_at":"2025-10-19T15:53:21.098Z","avatar_url":"https://github.com/TyHil.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# general-tree\n[![Run on Repl.it](https://repl.it/badge/github/TyHil/general-tree)](https://repl.it/github/TyHil/general-tree)\n## Description\nA general tree C++ library  \nUsing my [linked-list](https://github.com/TyHil/linked-list) library  \n## Documentation\n### Clear\n`template \u003ctypename T\u003e void generalTree\u003cT\u003e::clear(linkedList\u003ctreeNode\u003cT\u003e\u003e ** from)`  \nClears and deletes all nodes and data inside the given list.  \nParamaters: `linkedList\u003ctreeNode\u003cT\u003e\u003e ** from`: pointer to a linked list pointer  \n### Add\n`template \u003ctypename T\u003e void generalTree\u003cT\u003e::add(int dir[], int depth, T * newData)`  \nAdds a new node with specified data to the end of the linked list found by the specified direction.  \nParameters: `int dir[]`: list of locations in linked lists leading to the location, `int depth`: length of `dir`, `T * newData`: pointer to new data to be stored  \n### Get\n`template \u003ctypename T\u003e treeNode\u003cT\u003e * generalTree\u003cT\u003e::get(int dir[], int depth)`  \nReturns a pointer to the node at the specified direction.  \nParameters: `int dir[]`: list of locations in linked lists leading to the location, `int depth`: length of `dir`  \nReturns: `treeNode\u003cT\u003e *`: a pointer to the tree node at the specified direction  \n### Set\n`template \u003ctypename T\u003e void generalTree\u003cT\u003e::set(int dir[], int depth, T * newData)`  \nReplaces the data of node at the specified direction with new data.  \nParameters: `int dir[]`: list of locations in linked lists leading to the location, `int depth`: length of `dir`, `T * newData`: pointer to new data to be stored  \n### Insert\n`template \u003ctypename T\u003e void generalTree\u003cT\u003e::insert(int dir[], int depth, T * newData)`  \nInserts a new node and new data in the linked list specified by the direction and before the last index.  \nParameters: `int dir[]`: list of locations in linked lists leading to the location, `int depth`: length of `dir`, `T * newData`: pointer to new data to be stored  \n### Remove\n`template \u003ctypename T\u003e void generalTree\u003cT\u003e::remove(int dir[], int depth)`  \nRemoves the node and data at the specified direction.  \nParameters: `int dir[]`: list of locations in linked lists leading to the location, `int depth`: length of `dir`  \n### Is Empty\n`template \u003ctypename T\u003e bool generalTree\u003cT\u003e::isEmpty()`  \nReturns true if the tree has no elements in it.  \nReturns: `bool`: whether the tree is empty  \n### Swap\n`template \u003ctypename T\u003e void generalTree\u003cT\u003e::swap(int dir1[], int depth1, int dir2[], int depth2)`  \nSwitches the data pointers of the nodes at the specified directions.  \nParameters: `int dir1[]`: list of locations in linked lists leading to the first location, `int depth1`: length of `dir1`, `int dir2[]`: list of locations in linked lists leading to the second location, `int depth2`: length of `dir2`  \n## License\nGPL-3.0 License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyhil%2Fgeneral-tree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftyhil%2Fgeneral-tree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyhil%2Fgeneral-tree/lists"}