Documentation ¶
Index ¶
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 is a trie data structure that supports insertion and lookup of strings and prefixes of inserted strings.
func (*Trie) Contents ¶
Contents returns all the strings that have been inserted into the Trie. The worst case time complexity is O(m) where m is the sum of the lengths of all strings that have been inserted.
func (*Trie) Exists ¶
Exists tests if the string `word` has been inserted into the Trie. It takes O(r) time where r is the length of `word`.
func (*Trie) Insert ¶
Insert inserts the string `word` into the Trie. It takes O(r) time where r is the length of `word`.
func (*Trie) PrefixExists ¶
PrefixExists tests if the any string with the prefix `word` has been inserted into the Trie. It takes O(r) time where r is the length of `word`.