{"id":24873029,"url":"https://github.com/zpnst/different-trees","last_synced_at":"2025-07-03T02:05:36.683Z","repository":{"id":211320615,"uuid":"728802622","full_name":"zpnst/different-trees","owner":"zpnst","description":"Here you will find the implementation and explanation of the following trees: Binary Tree, AVL Binary Tree, Red Black Tree, Splay Tree in C++","archived":false,"fork":false,"pushed_at":"2024-02-02T10:32:30.000Z","size":173,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-03T02:03:53.220Z","etag":null,"topics":["avl-tree","binary-tree","cpp20","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/zpnst.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,"zenodo":null}},"created_at":"2023-12-07T18:18:23.000Z","updated_at":"2025-05-29T12:02:39.000Z","dependencies_parsed_at":"2023-12-07T20:23:53.250Z","dependency_job_id":"c3110676-bd74-47b1-89fb-4d7c2b0d8a50","html_url":"https://github.com/zpnst/different-trees","commit_stats":null,"previous_names":["zpnst/different-trees"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zpnst/different-trees","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zpnst%2Fdifferent-trees","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zpnst%2Fdifferent-trees/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zpnst%2Fdifferent-trees/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zpnst%2Fdifferent-trees/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zpnst","download_url":"https://codeload.github.com/zpnst/different-trees/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zpnst%2Fdifferent-trees/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263245303,"owners_count":23436512,"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":["avl-tree","binary-tree","cpp20","tree-structure"],"created_at":"2025-02-01T05:27:05.105Z","updated_at":"2025-07-03T02:05:36.644Z","avatar_url":"https://github.com/zpnst.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Implementation of various trees in C++\n![image](https://github.com/zpnst/different-trees/assets/105946529/69fb44f1-a6a6-47ef-b55c-91d26c05cceb)\n## The following trees are implemented in this repository:\n  1. [Binary Tree](trees/binary-tree)\n  2. [AVL Binary Tree](trees/avl-binary-tree)\n  3. [Red Black Tree](trees/red-black-tree)\n  4. [Splay Tree](trees/splay-tree)\n\nEach tree has its own characteristics, which I will not describe in detail, since countless Internet resources have done it for me.\n\n## How to draw a tree based on the output in the terminal\n\nYou need to use the level_order_print() function.\nBut do not confuse it with the order_print() function, it outputs the elements of the tree in order(from smaller to larger).\n\n![image](https://github.com/zpnst/different-trees/assets/105946529/b7fc1008-f798-4d2b-a74f-46fef8fd53cf)\n\nNext, simply restore the tree according to the simplest rules of a binary tree(\u003e= - to the right, \u003c - to the left), abstracting from the type of tree.\n\n## Our example\nIn our example, we insert an array of numbers {100, 50, 150, 25, 55, 175, 125, 300, 1000}, and then we delete the values 150, 50 and 1000.\n\nWhat will happen to a simple search tree after all the above actions:\n![image](https://github.com/zpnst/different-trees/assets/105946529/74358117-3ad8-493b-8c10-3bb6422c4b5d)\n\n## Navigation\n\nTo learn more about the implementation of each of the trees and their brief description, follow these paths (*I recommend in this order*):\n\n```\ntrees/binary-tree\ntrees/avl-binary-tree\ntrees/red-black-tree\ntrees/splay-tree\n```\n\nEach folder will show the trees before and after deleting the items and briefly describe their properties\n\n## Assembling\n\nFrom the root folder \"different-trees\" type the following commands:\n\n```\ncmake -S . -B build\nmake --build build\ncd build/\n./comparison\n```\n\nIf you did everything right, then you will get this result:\n\n![image](https://github.com/zpnst/different-trees/assets/105946529/c68e952b-28ed-47f8-b58d-e2716e4bde29)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzpnst%2Fdifferent-trees","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzpnst%2Fdifferent-trees","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzpnst%2Fdifferent-trees/lists"}