v0.1.0 — initial release
Adaptive Radix Tree as a sorted map from []byte to V.
Highlights
- Generic
Tree[V any]public API (New,Put,Get,Delete,Len,All,Range). - O(k)
Put/Get/Delete, O(1)Len. - Sorted iteration via Go 1.23 range-over-func (
All,Range). - Path compression with prefix splitting and terminal-carrying collapse.
- Inline small-key buffer (≤ 24 bytes) to halve
Putallocations. - Adaptive node sizing (node4 / node16 / node48 / node256) with promotion and demotion.
- Differential fuzzer against
map[string]V+ sorted oracle — 45M+ execs, zero divergences. - Mutation testing efficacy 96.55 % (100 % of killable mutants).
- Six verified
ExampleTree_*functions. - Package documentation (
doc.go) and goroutine-safety contract onTree.
Concurrency
A Tree is not safe for concurrent use by multiple goroutines when any goroutine is writing. Guard with your own sync.RWMutex if needed.
Install
go get github.com/KentBeck/AdaptiveRadixTree2@v0.1.0