Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct { Char string Children [26]*Node IsEndOfWord bool // contains filtered or unexported fields }
Node represents a single character in the trie. Char is the string repersentation of the character Each node has 26 childe nodes which represent each letter of the alphabet.
type Trie ¶
type Trie struct {
RootNode *Node
}
Trie is the tree that will hold all of the nodes. RootNode is always nil.
func NewTrie ¶
func NewTrie() *Trie
NewTrie creates a new trie with a root. This node is not used to match words so it can be anything; ie "\000".
func (*Trie) SearchWord ¶
SearchWord will return false if the word is not in the trie and true if it is in th trie.
Click to show internal directories.
Click to hide internal directories.