{"id":26232908,"url":"https://github.com/mikenye/gotrees","last_synced_at":"2026-04-21T08:07:33.113Z","repository":{"id":281584526,"uuid":"944951166","full_name":"mikenye/gotrees","owner":"mikenye","description":"A generic Binary Search Tree (BST) implementation in Go, supporting both unbalanced and balanced trees (e.g., Red-Black Trees)","archived":false,"fork":false,"pushed_at":"2025-03-20T14:37:27.000Z","size":125,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-26T20:14:06.819Z","etag":null,"topics":["bst","go","golang","rbtree","red-black-tree","red-black-trees"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/mikenye/gotrees","language":"Go","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/mikenye.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-08T10:00:50.000Z","updated_at":"2025-03-20T14:38:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"9a89b567-569c-40dc-813c-8c60b3f7acd2","html_url":"https://github.com/mikenye/gotrees","commit_stats":null,"previous_names":["mikenye/gotrees"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/mikenye/gotrees","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikenye%2Fgotrees","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikenye%2Fgotrees/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikenye%2Fgotrees/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikenye%2Fgotrees/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikenye","download_url":"https://codeload.github.com/mikenye/gotrees/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikenye%2Fgotrees/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32082797,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T06:27:27.065Z","status":"ssl_error","status_checked_at":"2026-04-21T06:27:21.250Z","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":["bst","go","golang","rbtree","red-black-tree","red-black-trees"],"created_at":"2025-03-13T00:39:39.360Z","updated_at":"2026-04-21T08:07:33.106Z","avatar_url":"https://github.com/mikenye.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gotrees - Generic Binary Search Trees in Go\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/mikenye/gotrees)](https://goreportcard.com/report/github.com/mikenye/gotrees)\n[![codecov](https://codecov.io/gh/mikenye/gotrees/graph/badge.svg?token=SXQZZUMRAX)](https://codecov.io/gh/mikenye/gotrees)\n[![Go Reference](https://pkg.go.dev/badge/github.com/mikenye/gotrees.svg)](https://pkg.go.dev/github.com/mikenye/gotrees)\n[![bencher](https://img.shields.io/badge/🐰_bencher-benchmarks-blue)](https://bencher.dev/perf/gotrees/plots)\n\n## Overview\n\n**gotrees** is a pure Go implementation of **generic binary search trees**, designed for flexibility and efficiency. It provides:\n\n- **`bst`:** A **basic, non-self-balancing** Binary Search Tree (BST).\n- **`rbtree`:** A **self-balancing Red-Black Tree** (extends `bst`).\n\nBoth implementations are **written entirely in Go** (**no Cgo**), ensuring **portability** and **easy integration** into any Go project.\n\n## Why gotrees Exists\n\n1. **Generic Support:** Before Go introduced generics, BSTs often relied on `interface{}`, leading to runtime type assertions and reduced type safety.\n2. **Extensibility:** `bst` provides a foundation for creating custom tree structures (e.g., Red-Black Trees, AVL Trees).\n3. **Learning \u0026 Exploration:** Developed to deepen understanding of balanced tree structures while prioritizing usability.\n\n## Installation\n\n```sh\ngo get github.com/mikenye/gotrees\n```\n\n## Package Overview\n\n### **[bst - Binary Search Tree](./bst/)**\n\nA **generic, pointer-based Binary Search Tree (BST)** that supports:\n- **Ordered key-value storage** (via a user-defined comparison function).\n- **Efficient traversal and search operations**.\n- **Manual structure modification** (for creating custom balanced trees).\n- **Extensibility** (for extending to create Red-Black Trees, AVL Trees, etc).\n\n\u003e ⚠️ **`bst` does not self-balance** – for a balanced BST, use `rbtree`.\n\n### **[rbtree - Red-Black Tree](./rbtree/)**\n\nA **self-balancing Red-Black Tree**, extending `bst`. It ensures:\n- **Automatic balancing** for O(log n) performance.\n- **Preservation of Red-Black Tree properties** (no consecutive red nodes, balanced black height).\n- **Safe insertions and deletions without manual balancing**.\n\n## Features\n- **✅ Well documented** – Every function documented.\n- **✅ 100% Go Implementation** – No Cgo dependencies.\n- **✅ Fully Generic** – Supports any key and value types.\n- **✅ Extensible** – `bst` can be used to build other trees.\n\n## Limitations\n- **Not Thread-Safe** – External synchronization is required for concurrent access.\n- **No Duplicate Keys** – Each key must be unique.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikenye%2Fgotrees","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikenye%2Fgotrees","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikenye%2Fgotrees/lists"}