{"id":20110539,"url":"https://github.com/orelba/binary-search-tree","last_synced_at":"2025-03-02T18:27:00.183Z","repository":{"id":169192465,"uuid":"597474381","full_name":"Orelba/binary-search-tree","owner":"Orelba","description":"Building a balanced binary search tree (BST)","archived":false,"fork":false,"pushed_at":"2023-02-09T20:16:12.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-13T05:42:08.329Z","etag":null,"topics":["balanced-search-trees","binary-search-tree","computer-science","data-structures"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/Orelba.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}},"created_at":"2023-02-04T17:03:54.000Z","updated_at":"2023-02-04T17:22:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"dd2fe4a9-6eef-477a-b553-e9b8f987cf15","html_url":"https://github.com/Orelba/binary-search-tree","commit_stats":null,"previous_names":["orelba/binary-search-tree"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Orelba%2Fbinary-search-tree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Orelba%2Fbinary-search-tree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Orelba%2Fbinary-search-tree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Orelba%2Fbinary-search-tree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Orelba","download_url":"https://codeload.github.com/Orelba/binary-search-tree/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241550565,"owners_count":19980769,"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":["balanced-search-trees","binary-search-tree","computer-science","data-structures"],"created_at":"2024-11-13T18:12:20.177Z","updated_at":"2025-03-02T18:27:00.148Z","avatar_url":"https://github.com/Orelba.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Data Structures: Binary Search Tree\nAn implementation of a balanced binary search tree (BST) in Javascript.\n\n## To run the script:\nRun `script.js`.\n\nThere is already a demonstration of some of the methods in the file,  \nYou can use all the methods available below.\n\n## Includes the following methods:\n* `insert(key)` - inserts a new node with the given key into the tree\n* `delete(key)` - deletes the node holding the given key from the tree\n* `find(key)` - returns the node holding the given key in the tree\n* `levelOrder(callbackFn)` **\u0026ast;** - traverses each node of the tree in level order.\n* `inorder(callbackFn)` **\u0026ast;** - traverses each node of the tree inorder\n* `preorder(callbackFn)` **\u0026ast;** - traverses each node of the tree preorder\n* `postorder(callbackFn)` **\u0026ast;** - traverses each node of the tree postorder\n* `height(node)` - returns the height of a node -- defined as the longest path between the node and a leaf node\n* `depth(node)` - returns the depth of a node -- defined as the distance between the node and the root\n* `isBalanced()` - returns true/false based on whether or not the tree is balanced\n* `rebalance()` - rebalances the tree\n* `prettyPrint()` - prints the tree in the console in a human reader friendly format\n\n### Additional note for methods that have an asterisk(*): \n\n**\u0026ast;** **If a callback function is provided, each node of the binary tree will be provided as the argument to the provided function, otherwise an array of node keys will be returned.**","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forelba%2Fbinary-search-tree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forelba%2Fbinary-search-tree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forelba%2Fbinary-search-tree/lists"}