Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Trie ¶
type Trie[T any] struct { // contains filtered or unexported fields }
Trie implements a prefix tree optimized for memory usage with shared prefixes
func (*Trie[T]) Delete ¶
Delete removes a key-value pair from the trie Time complexity: O(k * log n) where k is the number of parts in the key and n is the average number of children per node
func (*Trie[T]) Get ¶
Get retrieves a value from the trie Time complexity: O(k * log n) where k is the number of parts in the key and n is the average number of children per node
func (*Trie[T]) GetByPrefix ¶
GetByPrefix returns all key-value pairs with the given prefix Time complexity: O(k * log n + m) where k is the number of parts in the prefix, n is the average number of children per node, and m is the number of matching nodes