package radix
import "github.com/influxdata/influxdb/pkg/radix"
Index ¶
- func SortUint64s(x []uint64)
- type Tree
- func New() *Tree
- func NewFromMap(m map[string]int) *Tree
- func (t *Tree) DeletePrefix(s []byte) int
- func (t *Tree) Get(s []byte) (int, bool)
- func (t *Tree) Insert(s []byte, v int) (int, bool)
- func (t *Tree) Len() int
- func (t *Tree) Maximum() ([]byte, int, bool)
- func (t *Tree) Minimum() ([]byte, int, bool)
Functions ¶
func SortUint64s ¶
func SortUint64s(x []uint64)
SortUint64s sorts a slice of uint64s.
Types ¶
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
Tree implements a radix tree. This can be treated as a Dictionary abstract data type. The main advantage over a standard hash map is prefix-based lookups and ordered iteration. The tree is safe for concurrent access.
func New ¶
func New() *Tree
New returns an empty Tree
func NewFromMap ¶
NewFromMap returns a new tree containing the keys from an existing map
func (*Tree) DeletePrefix ¶
DeletePrefix is used to delete the subtree under a prefix Returns how many nodes were deleted Use this to delete large subtrees efficiently
func (*Tree) Get ¶
Get is used to lookup a specific key, returning the value and if it was found
func (*Tree) Insert ¶
Insert is used to add a newentry or update an existing entry. Returns if inserted.
func (*Tree) Len ¶
Len is used to return the number of elements in the tree
func (*Tree) Maximum ¶
Maximum is used to return the maximum value in the tree
func (*Tree) Minimum ¶
Minimum is used to return the minimum value in the tree
Source Files ¶
- Version
- v1.12.0 (latest)
- Published
- Apr 8, 2025
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 2 days ago –
Tools for package owners.