trie

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MIT, MIT Imports: 0 Imported by: 0

README

go-trie

供Go语言使用的Trie

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RuneTrie

type RuneTrie struct {
	Trie
}

RuneTrie Rune字典树

func (RuneTrie) Count

func (t RuneTrie) Count() int

Count 元素数量

func (RuneTrie) Find

func (t RuneTrie) Find(data []rune) bool

Find 查找

func (*RuneTrie) Grow

func (t *RuneTrie) Grow(data []rune)

Grow 生长

func (RuneTrie) MatchPrefix

func (t RuneTrie) MatchPrefix(data []rune) bool

MatchPrefix 匹配前缀

func (RuneTrie) MatchSuffix

func (t RuneTrie) MatchSuffix(data []rune) bool

MatchSuffix 匹配后缀

func (RuneTrie) ReverseFind

func (t RuneTrie) ReverseFind(data []rune) bool

ReverseFind 逆序查找

func (*RuneTrie) ReverseGrow

func (t *RuneTrie) ReverseGrow(data []rune)

ReverseGrow 逆序生长

type StringTrie

type StringTrie struct {
	RuneTrie
}

StringTrie String字典

func (StringTrie) Count

func (t StringTrie) Count() int

Count 元素数量

func (StringTrie) Find

func (t StringTrie) Find(s string) bool

Find 查找

func (*StringTrie) Grow

func (t *StringTrie) Grow(s string)

Grow 生长

func (StringTrie) MatchPrefix

func (t StringTrie) MatchPrefix(s string) bool

MatchPrefix 匹配前缀

func (StringTrie) MatchSuffix

func (t StringTrie) MatchSuffix(s string) bool

MatchSuffix 匹配后缀

func (StringTrie) ReverseFind

func (t StringTrie) ReverseFind(s string) bool

ReverseFind 倒序查找

func (*StringTrie) ReverseGrow

func (t *StringTrie) ReverseGrow(s string)

ReverseGrow 倒序生长

type Trie

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

Trie 字典树

func (Trie) Count

func (t Trie) Count() int

Count 数量

func (Trie) Find

func (t Trie) Find(data []interface{}) bool

Find 在Trie中查找该数组是否存在

func (*Trie) Grow

func (t *Trie) Grow(data []interface{})

Grow 根据给定的[]interface{}进行生长

func (Trie) MatchPrefix

func (t Trie) MatchPrefix(data []interface{}) bool

MatchPrefix 在Trie中查找是否存在该数组匹配的前缀

func (Trie) MatchSuffix

func (t Trie) MatchSuffix(data []interface{}) bool

MatchSuffix 在Trie中查找是否存在该数组匹配的后缀

func (Trie) ReverseFind

func (t Trie) ReverseFind(data []interface{}) bool

ReverseFind 在Trie中倒序查找数组

func (*Trie) ReverseGrow

func (t *Trie) ReverseGrow(data []interface{})

ReverseGrow 根据给定[]interface{}的倒序进行生长

Jump to

Keyboard shortcuts

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