Registry / utility / twmb-go-rbtree

twmb-go-rbtree

JSON →
library1.0.0gogounverified

An iterative (non-recursive) red-black tree implementation with resettable iteration and node modification support.

go get github.com/twmb/go-rbtree
INSTALL
IMPORT
SIG · TWMB-GO-RBTREE
T
twmb-go-rbtree
utilitygov1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

rbtree
github.com/twmb/go-rbtree

Insert and retrieve a key-value pair

package main import ( "fmt" "github.com/twmb/go-rbtree" ) func main() { tree := rbtree.New[int, string]() tree.Insert(1, "one") val, ok := tree.Get(1) if ok { fmt.Println(val) } }
Debug
Known issues
gotchaModifying the tree during iteration can invalidate the iterator; you may need to reset it.
fix
Avoid modifying the tree while iterating, or reset the iterator after modifications.
affects: *
Upgrade
Version history
1.0.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
twmb-go-rbtree — go get twmb-go-rbtree · libregistry