{"id":20381698,"url":"https://github.com/jacob-c-smith/tree","last_synced_at":"2026-06-11T09:31:41.132Z","repository":{"id":203419683,"uuid":"709148189","full_name":"Jacob-C-Smith/tree","owner":"Jacob-C-Smith","description":"Heierarchical structure of connected nodes","archived":false,"fork":false,"pushed_at":"2025-04-19T06:06:39.000Z","size":969,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-19T07:52:58.100Z","etag":null,"topics":["c","tree"],"latest_commit_sha":null,"homepage":"https://g10.app/status/#abstract_data_iii","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jacob-C-Smith.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":"2023-10-24T05:49:09.000Z","updated_at":"2025-04-19T06:06:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"79de181a-92d4-4b30-93d4-928e1515f206","html_url":"https://github.com/Jacob-C-Smith/tree","commit_stats":{"total_commits":37,"total_committers":1,"mean_commits":37.0,"dds":0.0,"last_synced_commit":"74c66ce1de80f26a30c568d0d3d13214afd363e2"},"previous_names":["jacob-c-smith/tree"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Jacob-C-Smith/tree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jacob-C-Smith%2Ftree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jacob-C-Smith%2Ftree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jacob-C-Smith%2Ftree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jacob-C-Smith%2Ftree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jacob-C-Smith","download_url":"https://codeload.github.com/Jacob-C-Smith/tree/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jacob-C-Smith%2Ftree/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34192870,"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-11T02:00:06.485Z","response_time":57,"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":["c","tree"],"created_at":"2024-11-15T02:14:59.087Z","updated_at":"2026-06-11T09:31:41.114Z","avatar_url":"https://github.com/Jacob-C-Smith.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tree\n[![CMake](https://github.com/Jacob-C-Smith/tree/actions/workflows/cmake.yml/badge.svg?branch=main)](https://github.com/Jacob-C-Smith/tree/actions/workflows/cmake.yml)\n\n**Dependencies:**\\\n[![sync](https://github.com/Jacob-C-Smith/sync/actions/workflows/cmake.yml/badge.svg)](https://github.com/Jacob-C-Smith/sync/actions/workflows/cmake.yml)\n\n Implementation of different tree structures in C\n \n \u003e 1 [Download](#download)\n \u003e\n \u003e 2 [Build](#build)\n \u003e\n \u003e 3 [Example](#example)\n \u003e\n \u003e\u003e 3.1 [Example output](#example-output)\n \u003e\n \u003e 4 [Tester](#tester)\n \u003e\n \u003e 5 [Definitions](#definitions)\n \u003e\n \u003e\u003e 5.1 [Type definitions](#type-definitions)\n \u003e\u003e\n \u003e\u003e 5.2 [Function definitions](#function-definitions)\n\n ## Download\n To download tree, execute the following command\n ```bash\n $ git clone https://github.com/Jacob-C-Smith/tree\n ```\n ## Build\n To build on UNIX like machines, execute the following commands in the same directory\n ```bash\n $ cd tree\n $ cmake .\n $ make\n ```\n  This will build the example program, the tester program, and dynamic / shared libraries\n\n  To build tree for Windows machines, open the base directory in Visual Studio, and build your desired target(s)\n ## Example\n To run the example program, execute this command\n ```\n $ ./tree_example\n ```\n ### Example output\n ```\n TODO\n ```\n [Source](main.c)\n\n## Tester\n TODO: \n \n ## Definitions\n ### Binary tree \n #### Type definitions\n```c\n// Type definitions\ntypedef struct binary_tree_s      binary_tree;\ntypedef struct binary_tree_node_s binary_tree_node;\n\ntypedef int (fn_binary_tree_serialize) (FILE *p_file, binary_tree_node *p_binary_tree_node);\ntypedef int (fn_binary_tree_parse)     (FILE *p_file, binary_tree_node *p_binary_tree_node);\ntypedef int (fn_binary_tree_traverse)  (void *p_key, void *p_value);\n```\n\n#### Function definitions\n ```c\n// Allocators\nint binary_tree_create ( binary_tree **const pp_binary_tree );\n\n// Constructors\nint binary_tree_construct ( binary_tree **const pp_binary_tree, fn_tree_equal *pfn_is_equal, unsigned long long node_size );\n\n// Accessors\nint binary_tree_search ( const binary_tree *const p_binary_tree, const void *const p_key, const void **const pp_value );\n\n// Mutators\nint binary_tree_insert ( binary_tree *const p_binary_tree, const void *const p_key, const void  *const p_value );\nint binary_tree_remove ( binary_tree *const p_binary_tree, const void *const p_key, const void **const p_value );\n\n// Traversal\nint binary_tree_traverse_preorder  ( binary_tree *const p_binary_tree, fn_binary_tree_traverse *pfn_traverse );\nint binary_tree_traverse_inorder   ( binary_tree *const p_binary_tree, fn_binary_tree_traverse *pfn_traverse );\nint binary_tree_traverse_postorder ( binary_tree *const p_binary_tree, fn_binary_tree_traverse *pfn_traverse );\n\n// Parser\nint binary_tree_parse ( binary_tree **const pp_binary_tree, const char *p_file, fn_tree_equal *pfn_is_equal, fn_binary_tree_parse *pfn_parse_node );\n\n// Serializer\nint binary_tree_serialize ( binary_tree *const p_binary_tree, const char *p_path, fn_binary_tree_serialize *pfn_serialize_node );\n\n// Destructors\nint binary_tree_destroy ( binary_tree **const pp_binary_tree );\n ```\n\n ### B tree\n #### Type definitions\n ```c\ntypedef struct b_tree_s           b_tree;\ntypedef struct b_tree_node_s      b_tree_node;\ntypedef struct b_tree_metadata_s  b_tree_metadata;\n\ntypedef int (fn_b_tree_serialize) (FILE *p_file, b_tree_node *p_b_tree_node);\ntypedef int (fn_b_tree_parse)     (FILE *p_file, b_tree *p_b_tree, b_tree_node **pp_b_tree_node, unsigned long long node_pointer );\ntypedef int (fn_b_tree_traverse)  (void *p_key, void *p_value);\n ```\n #### Function definitions\n ```c\n// Allocators\nint b_tree_create ( b_tree **const pp_b_tree );\n\n// Constructors\nint b_tree_construct ( b_tree **const pp_b_tree, const char *const path, fn_tree_equal *pfn_is_equal, int degree, unsigned long long node_size );\n\n// Accessors\nint b_tree_search ( const b_tree *const p_b_tree, const void *const p_key, const void **const pp_value );\n\n// Mutators\nint b_tree_insert ( b_tree *const p_b_tree, const void *const p_key, const void *const p_value );\nint b_tree_remove ( b_tree *const p_b_tree, const void *const p_key, const void **const p_value );\n\n// Traversal\nint binary_tree_traverse_preorder  ( b_tree *const p_b_tree, fn_b_tree_traverse *pfn_traverse );\nint binary_tree_traverse_inorder   ( b_tree *const p_b_tree, fn_b_tree_traverse *pfn_traverse );\nint binary_tree_traverse_postorder ( b_tree *const p_b_tree, fn_b_tree_traverse *pfn_traverse );\n\n// Parser\nint b_tree_parse ( b_tree **const pp_b_tree, FILE *p_file, fn_tree_equal *pfn_is_equal, fn_b_tree_parse *pfn_parse_node );\n\n// Serializer\nint b_tree_serialize ( b_tree *const p_b_tree, const char *p_path, fn_b_tree_serialize *pfn_serialize_node );\n\n// Destructors\nint b_tree_destroy ( b_tree **const pp_b_tree );\n ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacob-c-smith%2Ftree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacob-c-smith%2Ftree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacob-c-smith%2Ftree/lists"}