trie

package
v0.0.0-...-b95a7b5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 25, 2024 License: BSD-3-Clause Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Trie

type Trie struct {
	// contains filtered or unexported fields
}

Trie is a struct used for efficient searching on sets of strings.

func New

func New() *Trie

New returns a Trie instance.

func (*Trie) Delete

func (t *Trie) Delete(strs []string, data interface{})

Delete removes the data from the trie.

func (*Trie) Insert

func (t *Trie) Insert(strs []string, data interface{})

Insert inserts the data into the trie with the given string keys.

func (*Trie) Len

func (t *Trie) Len() int

func (*Trie) Search

func (t *Trie) Search(strs []string) []interface{}

Search returns all inserted data which exactly matches the given string keys.

func (*Trie) SearchSubset

func (t *Trie) SearchSubset(strs []string) []interface{}

SearchSubset returns all inserted data which matches a subset of the given string keys.

func (*Trie) String

func (t *Trie) String() string

String returns a string representation of the Trie.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL