Skip to content

Commit 320efd7

Browse files
committed
Update index.go
1 parent fbfee20 commit 320efd7

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

implement-trie-prefix-tree/index.go

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,24 @@
11
package implement_trie_prefix_tree
2-
3-
type PrefixTree struct {
4-
isEnd bool
5-
children map[byte]*PrefixTree
6-
rest string
7-
}
82
type Trie struct {
9-
root *PrefixTree
3+
104
}
115

6+
127
func Constructor() Trie {
138

14-
return Trie{root: &PrefixTree{children: make(map[byte]*PrefixTree)}}
159
}
1610

17-
func (this *Trie) Insert(word string) {
11+
12+
func (this *Trie) Insert(word string) {
1813

1914
}
2015

16+
2117
func (this *Trie) Search(word string) bool {
2218

2319
}
2420

21+
2522
func (this *Trie) StartsWith(prefix string) bool {
2623

2724
}

0 commit comments

Comments
 (0)