trie

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WildCard = '*'
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Trie

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

字典树

func NewTrie

func NewTrie() *Trie

构造字典树

func (*Trie) Insert

func (trie *Trie) Insert(word []byte)

向字典树中插入一个单词,大小写敏感

func (*Trie) Search

func (trie *Trie) Search(word []byte) bool

搜索字典树中是否存在指定单词,匹配前缀即可

type TrieNode

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

字典树节点

Jump to

Keyboard shortcuts

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