Documentation ¶
Overview ¶
Package core provides essential abstractions for building a trie tree
Package core provides essential abstractions for building a trie tree
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
This struct provides a node structure
@attr char: string @attr children: slice
type Trie ¶
type Trie struct {
// contains filtered or unexported fields
}
This struct provides a Trie tree structure
func NewTrie ¶
func NewTrie() *Trie
This method provides a new Trie tree struture
For each new Trie tree created the root is initialised with the value "\000" that represents the nil value in UNICODE table ¶
@return &Trie: *Trie
func (*Trie) Insert ¶
This method is reponsible for insert a new element into the Trie
@param word: string - word to be inserted into the Trie
@return _, error: nil, _ - if something went wrong nothing happens, otherwise thats OK
func (*Trie) RemoveWord ¶
This methods is responsible for delete a word from the Trie
@param word: string - word to be deleted from the Trie
@return bool - if deleted, return true, otherwise return false
func (*Trie) SearchWord ¶
This methods is responsible for search a word into the Trie
@param word: string - word to be searched into the Trie
@return bool - if found, return true, otherwise return false