{"id":20519486,"url":"https://github.com/allanevans/binarytree-swift","last_synced_at":"2025-08-22T12:37:17.867Z","repository":{"id":56900282,"uuid":"126915875","full_name":"AllanEvans/BinaryTree-Swift","owner":"AllanEvans","description":"A BinaryTree or binary search tree conforming to the AVL (G.M. Adel’son-Vel’skii and E.M. Landis) requirement of self-balancing","archived":false,"fork":false,"pushed_at":"2018-06-12T14:30:50.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-13T11:21:32.471Z","etag":null,"topics":["avl","binary-search-tree","random-access","swift4","thread-safe","tree"],"latest_commit_sha":null,"homepage":null,"language":"Swift","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/AllanEvans.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-27T02:17:55.000Z","updated_at":"2018-06-12T14:29:48.000Z","dependencies_parsed_at":"2022-08-21T02:21:02.115Z","dependency_job_id":null,"html_url":"https://github.com/AllanEvans/BinaryTree-Swift","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/AllanEvans/BinaryTree-Swift","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllanEvans%2FBinaryTree-Swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllanEvans%2FBinaryTree-Swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllanEvans%2FBinaryTree-Swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllanEvans%2FBinaryTree-Swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AllanEvans","download_url":"https://codeload.github.com/AllanEvans/BinaryTree-Swift/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllanEvans%2FBinaryTree-Swift/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270305723,"owners_count":24562096,"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","status":"online","status_checked_at":"2025-08-13T02:00:09.904Z","response_time":66,"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":["avl","binary-search-tree","random-access","swift4","thread-safe","tree"],"created_at":"2024-11-15T22:14:17.088Z","updated_at":"2025-08-13T20:21:02.286Z","avatar_url":"https://github.com/AllanEvans.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AEBinaryTree\nA BinaryTree or binary search tree conforming to the AVL (Adelson-Velsky and Landis) requirement of self-balancing where each subtree has left and right subtrees with depths (or heights) that differ by at most 1.  The BinaryTree class is generic and accepts any type that conforms to the Comparable protocol.\n\nSince many applications require sorting data as it arrives from some backend service, but then displaying it in the UI as an array, the BinaryTree class provides convenience methods for inserting elements and for providing an enumerated array property and random access indexing.  Additionally, the BinaryTree directly supports random access via a subscript method with O(logN) complexity, which should be sufficiently fast for delegation as a data source for a UITableView or UICollectionView.\n\nInternal operation of each BinaryTree instance is thread-safe.  The BinaryTree class provides convenience methods for  insert() and remove() and index(of:) operations with O(logN) complexity, with internal recursive operations performed off the main queue.\n\n# Usage\n\n```swift\nimport AEBinaryTree\n\nclass SomeClass {\n\n    var intTree: BinaryTree\u003cInt\u003e // A binary tree of integers\n    var stringTree: BinaryTree\u003cString\u003e // A binary tree of strings\n    var doubleTree: BinaryTree\u003cDouble\u003e // A binary tree of doubles, not the hotel chain\n    var someTree: BinaryTree\u003cSomeElement\u003e // A binary tree of SomeElement that conforms to the Comparable protocol\n\n}\n```\n# Adding To Your Project\n\n## CocoaPods\nCocoaPods is the recommended dependency manager:\n```ruby\n    pod AEBinaryTree\n```\n\n## Clone Repo\n```bash\n$ git clone https://github.com/AllanEvans/BinaryTree-Swift.git \u003cdirectory\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallanevans%2Fbinarytree-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fallanevans%2Fbinarytree-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallanevans%2Fbinarytree-swift/lists"}