Documentation ¶
Overview ¶
Package avl provides a barebones key-value pair accepting Avl implementation and a Keyless variant for user-defined key generation based on provided values.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Avl ¶
Avl is a rigidly self-balancing bst.Bst. Every single operation in worst case is O(log n). Avl has fast lookups and generally more efficient operations thanks to the balanced nature of the tree. Unless inserting highly randomized data, this variant is recommended over regular bst.Bst. Implements obt.Obt, refer to Keyless for obt.Keyless variant.
type KeyFunc ¶
KeyFunc is a key generating function signature for Avl variants with no explicit keys.
type Keyless ¶
Keyless is essentially a wrapper over a normal Avl with user-provided key generation out of inserted values. The overhead is miniscule (~15-20 nanoseconds more per op in comparison to the ordinary variant).
func NewKeyless ¶
NewKeyless constructs a *Keyless[Key, Value] with a key generating function for ordering.
func (*Keyless[K, V]) Contains ¶
func (k *Keyless[K, V]) Contains(value V) bool
Contains implements obt.KeylessObt.Contains
func (*Keyless[K, V]) Delete ¶
func (k *Keyless[K, V]) Delete(value V) (removed bool)
Delete implements obt.KeylessObt.Delete