README ¶ 208. Implement Trie (Prefix Tree) 题目 Implement a trie with insert, search, and startsWith methods. Note: You may assume that all inputs are consist of lowercase letters a-z. 解题思路 见程序注释 Expand ▾ Collapse ▴ Documentation ¶ Index ¶ type Trie func Constructor() Trie func (this *Trie) Insert(word string) func (this *Trie) Search(word string) bool func (this *Trie) StartsWith(prefix string) bool 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 是便于 word 插入与查找的数据结构 func Constructor ¶ func Constructor() Trie func (*Trie) Insert ¶ func (this *Trie) Insert(word string) func (*Trie) Search ¶ func (this *Trie) Search(word string) bool func (*Trie) StartsWith ¶ func (this *Trie) StartsWith(prefix string) bool Source Files ¶ View all Source files implement-trie-prefix-tree.go Click to show internal directories. Click to hide internal directories.