Skip to content

Commit fbfee20

Browse files
committed
Create index.go
1 parent ef234b1 commit fbfee20

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

implement-trie-prefix-tree/index.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package implement_trie_prefix_tree
2+
3+
type PrefixTree struct {
4+
isEnd bool
5+
children map[byte]*PrefixTree
6+
rest string
7+
}
8+
type Trie struct {
9+
root *PrefixTree
10+
}
11+
12+
func Constructor() Trie {
13+
14+
return Trie{root: &PrefixTree{children: make(map[byte]*PrefixTree)}}
15+
}
16+
17+
func (this *Trie) Insert(word string) {
18+
19+
}
20+
21+
func (this *Trie) Search(word string) bool {
22+
23+
}
24+
25+
func (this *Trie) StartsWith(prefix string) bool {
26+
27+
}

0 commit comments

Comments
 (0)