{"id":21062575,"url":"https://github.com/paragon279/binary-tree","last_synced_at":"2026-04-21T21:34:04.228Z","repository":{"id":204980788,"uuid":"713115666","full_name":"paragon279/binary-tree","owner":"paragon279","description":"data structures and algorithms =\u003e binary tree","archived":false,"fork":false,"pushed_at":"2023-11-08T21:21:22.000Z","size":9,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-14T01:14:37.595Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/paragon279.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","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}},"created_at":"2023-11-01T21:44:15.000Z","updated_at":"2024-03-14T20:43:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"7863616c-da7a-4e0f-90fd-9717a07072de","html_url":"https://github.com/paragon279/binary-tree","commit_stats":null,"previous_names":["yinyangwarrior0928/binary-tree","c0r2a-lab/binary-tree","paragon279/binary-tree"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/paragon279/binary-tree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paragon279%2Fbinary-tree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paragon279%2Fbinary-tree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paragon279%2Fbinary-tree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paragon279%2Fbinary-tree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paragon279","download_url":"https://codeload.github.com/paragon279/binary-tree/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paragon279%2Fbinary-tree/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32111100,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T11:25:29.218Z","status":"ssl_error","status_checked_at":"2026-04-21T11:25:28.499Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-19T17:39:17.734Z","updated_at":"2026-04-21T21:34:04.178Z","avatar_url":"https://github.com/paragon279.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Binary Search Tree\n\nAn implementation of binary search trees using shared pointers\n\n## Overview\n\nA **Binary Search Tree (BST)** is a node-based data structure.\n\nBinary search requires that we have access to two elements, specifically the median elements about and below the given node. This repository uses a **header-only** file `binary_search_tree.h` that handles the basic operations of a Binary Search Tree: insertion, searching, traversing, and removal (or deletion). The program uses `std::shared_ptr` to store the trees.\n\n## Build and Run\n\nTested for `C++11` and `C++14` and compiled with `g++ 6.3.0`.\n\n### GNU/Linux Users\n\n**1. Compile from terminal**\n\n```\ncd \u003cdirectory\u003e\ng++ -std=c++14 -c main.cpp\ng++ -std=c++14 -o bst.exe main.o\n```\n\n**2. Run the program**\n\n```\n./bst.exe\n```\n\n## Example Usage\n\n``` CPP\n#include \u003ciostream\u003e\n#include \u003cmemory\u003e\n#include \"binary_search_tree.h\"\n\nint main(int argc, char** argv)\n{\n    auto rootNode = std::make_shared\u003ctree\u003cint\u003e\u003e(50, nullptr, nullptr);\n    auto binarySearchTree = std::make_shared\u003cbinary_search_tree\u003cint\u003e\u003e();\n    \n    // Insert nodes after the root node\n    binarySearchTree-\u003einsert_tree(rootNode, 30);\n    binarySearchTree-\u003einsert_tree(rootNode, 70);\n    binarySearchTree-\u003einsert_tree(rootNode, 20);\n    binarySearchTree-\u003einsert_tree(rootNode, 40);\n    binarySearchTree-\u003einsert_tree(rootNode, 60);\n    binarySearchTree-\u003einsert_tree(rootNode, 80);\n    binarySearchTree-\u003einsert_tree(rootNode, 10);\n    binarySearchTree-\u003einsert_tree(rootNode, 45);\n    binarySearchTree-\u003einsert_tree(rootNode, 65);\n    binarySearchTree-\u003einsert_tree(rootNode, 90);\n    \n    std::cout \u003c\u003c \"Tree Node Count:\" \u003c\u003c \" \" \u003c\u003c binarySearchTree-\u003eget_tree_count(rootNode) \u003c\u003c \"\\n\" \u003c\u003c std::endl;\n    \n    // Traverse the tree nodes\n    binarySearchTree-\u003etraverse_tree(rootNode);\n    \n    // Remove nodes from the tree\n    binarySearchTree-\u003eremove_tree(rootNode, 50);\n    binarySearchTree-\u003eremove_tree(rootNode, 30);\n    binarySearchTree-\u003eremove_tree(rootNode, 70);\n    binarySearchTree-\u003eremove_tree(rootNode, 20);\n    binarySearchTree-\u003eremove_tree(rootNode, 40);\n    binarySearchTree-\u003eremove_tree(rootNode, 60);\n    binarySearchTree-\u003eremove_tree(rootNode, 80);\n    binarySearchTree-\u003eremove_tree(rootNode, 10);\n    binarySearchTree-\u003eremove_tree(rootNode, 45);\n    binarySearchTree-\u003eremove_tree(rootNode, 65);\n    binarySearchTree-\u003eremove_tree(rootNode, 90);\n    \n    rootNode.reset();\n    binarySearchTree.reset();\n           \n    return 0;\n}\n\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparagon279%2Fbinary-tree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparagon279%2Fbinary-tree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparagon279%2Fbinary-tree/lists"}